robustx.datasets package

Subpackages

Submodules

robustx.datasets.DatasetLoader module

class robustx.datasets.DatasetLoader.DatasetLoader(seed=None)[source]

Bases: ABC

An abstract class used to outline the minimal functionality of a dataset loader

Attributes / Properties

_data: pd.DataFrame

Stores the dataset as a DataFrame, only has value once load_data() called

X: pd.DataFrame

Stores the feature columns as a DataFrame, only has value once load_data() called

y: pd.DataFrame

Stores the target column as a DataFrame, only has value once load_data() called


get_negative_instances() pd.DataFrame:[source]

Filters all the negative instances in the dataset and returns them

get_random_positive_instance() pd.Series:[source]

Returns a random instance where the target variable is NOT the neg_value

-------
abstract property X: DataFrame

Returns only feature variables as DataFrame @return: pd.DataFrame

property data: DataFrame

Returns whole dataset as DataFrame @return: pd.DataFrame

get_negative_instances(neg_value, column_name='target')[source]

Filters all the negative instances in the dataset and returns them @param neg_value: What target value counts as a “negative” instance @param column_name: Target column’s name @return: All instances with a negative target value

Return type:

DataFrame

get_random_positive_instance(neg_value, column_name='target')[source]

Returns a random instance where the target variable is NOT the neg_value @param neg_value: What target value counts as a “negative” instance @param column_name: Target column’s name @return: Random instance in dataset with positive target value

Return type:

Series

abstract property y: Series

Returns only target variable as Series @return: pd.Series

robustx.datasets.ExampleDatasets module

robustx.datasets.ExampleDatasets.get_example_dataset(name, seed=None)[source]

Returns a DatasetLoader class given the name of an example dataset

@param name: the name of the dataset you wish to load, the options are:
  • iris

  • ionosphere

  • adult

  • titanic

@return: DatasetLoader

Module contents