conmo.preprocesses.preprocess.Preprocess

class conmo.preprocesses.preprocess.Preprocess[source]

Abstract base class for a Preprocess.

This class is an abstract class from which other subclasses inherit and must not be instanciated directly.

__init__()
abstract apply(in_dir: str, out_dir: str) None[source]

Applies the preprocess to the given dataset.

Parameters
  • in_dir (str) – Input directory where the files are located. Usually, this is the output directory of the splitter step.

  • out_dir (str) – Output directory where the files will be saved.

load_input(in_dir: str) -> (<class 'pandas.core.frame.DataFrame'>, <class 'pandas.core.frame.DataFrame'>)[source]

Read parquet data and labels files of the chosen dataset before it’s split.

Parameters

in_dir (str) – Input directory where the files are located.

Returns

  • data (Pandas Dataframe) – Loaded data file.

  • labels (Pandas Dataframe) – Loaded labels file.

save_output(out_dir: str, data: DataFrame, labels: DataFrame) None[source]

Save preprocessed dataset to parquet format.

Parameters
  • out_dir (str) – Output directory where the results will be saved.

  • data (Pandas Dataframe) – Preprocessed data.

  • labels (Pandas Dataframe) – Preprocessed labels.

show_start_message() None[source]

Simple method to print on the terminal the name of the selected splitter.

Methods

__init__()

apply(in_dir, out_dir)

Applies the preprocess to the given dataset.

load_input(in_dir)

Read parquet data and labels files of the chosen dataset before it's split.

save_output(out_dir, data, labels)

Save preprocessed dataset to parquet format.

show_start_message()

Simple method to print on the terminal the name of the selected splitter.