mlrl.testbed_arff.experiments.input.sources.source_arff module¶
Author Michael Rapp (michael.rapp.ml@gmail.com)
Provides classes that allow reading datasets from ARFF files.
- class mlrl.testbed_arff.experiments.input.sources.source_arff.ArffFileSource(directory: Path)¶
Bases:
DatasetFileSourceAllows to read a dataset from an ARFF file.
- class ArffDataset(arff_file: ArffFile, output_names: set[str] | None)¶
Bases:
objectProvides access to the content of an ARFF file and the corresponding Mulan XML file, if available.
- static from_file(arff_file: ArffFile, file_path: Path) ArffDataset¶
Creates and returns an ARFF dataset from given ARFF file and a corresponding Mulan XML file, if available.
- Parameters:
arff_file – The content of the ARFF file
file_path – The path to the XML file
- Returns:
The ARFF dataset that has been created
- class ArffFile(matrix: sparray, arff_attributes: list[Any], relation: str)¶
Bases:
objectProvides access to the content of an ARFF file.
- static from_file(file_path: Path, sparse: bool, dtype: dtype) ArffFile¶
Loads the content of an ARFF file.
- Parameters:
file_path – The path to the ARFF file
sparse – True, if the ARFF file is given in sparse format, False otherwise. If the given format is incorrect, an arff.BadLayout is raised
dtype – The type of the data matrix to be read from the file
- Returns:
An ArffFileSource.ArffFile that has been loaded
- SUFFIX_ARFF = 'arff'¶
- SUFFIX_XML = 'xml'¶