mlrl.testbed_sklearn.experiments.input.sources package

Author Michael Rapp (michael.rapp.ml@gmail.com)

Provides classes that allow to read input data from SVM (light) files.

class mlrl.testbed_sklearn.experiments.input.sources.SvmFileSource(directory: Path)

Bases: DatasetFileSource

Allows to read a dataset from an SVM (light) file.

SUFFIX_SVM = 'svm'
class SvmDataset(svm_file: SvmFile)

Bases: object

Provides access to the content of an SVM file.

property feature_matrix: sparray

The feature matrix contained in the dataset.

property features: list[Attribute]

A list that stores all features contained in the dataset.

static from_file(svm_file: SvmFile) SvmDataset

Creates and returns an SVM dataset from given SVM file.

Parameters:

svm_file – The content of the SVM file

Returns:

The SVM dataset that has been created

property output_matrix: sparray

The output matrix contained in the dataset.

property outputs: list[Attribute]

A list that stores all outputs contained in the dataset.

class SvmFile(feature_matrix: sparray, output_matrix: sparray)

Bases: object

Provides access to the content of an SVM file.

property features: list[Attribute]

A list that stores all features contained in the SVM file.

static from_file(file_path: Path, problem_domain: ProblemDomain) SvmFile

Loads the content of an SVM file.

Parameters:
  • file_path – The path to the SVM file

  • problem_domain – The problem domain, the SVM file is concerned with

Returns:

A SvmFileSource.SvmFile that has been loaded

property outputs: list[Attribute]

A list that stores all outputs contained in the SVM file.

Submodules