preprocessor.data_trimmer package

Submodules

preprocessor.data_trimmer.data_trimmer module

This File contains the DataTrimmer class. To run this script uncomment or add the following lines in the [options.entry_points] section in setup.cfg:

console_scripts =
data-trimmer = data_trimmer.__main__:main

Then run python setup.py install which will install the command data-trimmer inside your current environment.

class preprocessor.data_trimmer.data_trimmer.DataTrimmer(conf)[source]

Bases: preprocessor.preprocessor.Preprocessor

The Data Trimmer preprocessor class

core()[source]
Core preprocessor task after starting the instance with the main method.
Decide from the arguments, what trimming method to call.

Args: args (obj): command line parameters as objects

load_from_config()[source]
parse_args(args)[source]

Parse command line parameters

Parameters:args ([str]) – command line parameters as list of strings
Returns:command line parameters namespace
Return type:argparse.Namespace
store()[source]

Save preprocessed data and the configuration of the preprocessor.

trim_auto()[source]

Trims all the constant columns and trims all rows with consecutive zeroes from start and end of the input dataset

Returns: rows_t, cols_t (int,int): number of rows and columns trimmed

trim_columns()[source]

Trims all the constant columns from the input dataset

Returns:number of rows and columns trimmed
Return type:rows_t, cols_t (int,int)
trim_fixed_rows(from_start, from_end)[source]

Trims a configurable number of rows from the start or end of the input dataset

Parameters:
  • from_start (int) – number of rows to remove from start (ignored if auto_trim)
  • from_end (int) – number of rows to remove from end (ignored if auto_trim)
Returns:

number of rows and columns trimmed

Return type:

rows_t, cols_t (int,int)

preprocessor.data_trimmer.data_trimmer.run(args)[source]

Entry point for console_scripts

Module contents