lib

Library / helper functions for Keras-Pandas

Functions

check_valid_datatype(datatype_class) Check whether the provided datatype_class meets the requirements for use as a keras-pandas datatype handler, using duck-typing
check_variable_list_are_valid(variable_type_dict) Checks that the provided variable_type_dict is valid, by:
download_file(url, local_file_path, filename) Download the file at url in chunks, to the location at local_file_path
get_temp_dir()
get_variable_type(variable_name, …)
load_instanbul_stocks([as_ts])
load_iris()
load_lending_club([test_run])
load_mushroom()
load_titanic() Load the titanic data set, as a pandas DataFrame
namespace_conversion(input_string) Convert input_string to be sfve in the tensorflow namespace
lib.check_valid_datatype(datatype_class)

Check whether the provided datatype_class meets the requirements for use as a keras-pandas datatype handler, using duck-typing

Parameters:datatype_class – A class, with the expected signature
Returns:Whether or not the datatype_class has the requirements
Return type:bool
lib.check_variable_list_are_valid(variable_type_dict)

Checks that the provided variable_type_dict is valid, by:

  • Confirming there is no overlap between all variable lists
Parameters:variable_type_dict ({str:[str]}) – A dictionary, with keys describing variables types, and values listing particular variables
Returns:True, if there is no overlap
Return type:bool
lib.download_file(url, local_file_path, filename)

Download the file at url in chunks, to the location at local_file_path

Parameters:
  • url (str) – URL to a file to be downloaded
  • local_file_path (str) – Path to download the file to
  • filename (str) – Filename to save the data to
Returns:

The path to the file on the local machine (same as input local_file_path)

Return type:

str

lib.get_temp_dir()
lib.get_variable_type(variable_name, variable_type_dict, response_var)
lib.load_instanbul_stocks(as_ts=False)
lib.load_iris()
lib.load_lending_club(test_run=True)
lib.load_mushroom()
lib.load_titanic()

Load the titanic data set, as a pandas DataFrame

Returns:A DataFrame, containing the titanic dataset
Return type:pandas.DataFrame
lib.namespace_conversion(input_string)

Convert input_string to be sfve in the tensorflow namespace

Parameters:input_string (str) – A string, to be converted
Returns:Cleanly formatted version of input_string
Return type:str