culebra.tools.abc.scripts.TrainingTestDataGenerator class¶
- class TrainingTestDataGenerator(args: list[str] | None = None)¶
Bases:
GeneratorScriptConstruct the generator.
Define the command-line arguments.
Class attributes¶
- TrainingTestDataGenerator.default_random_seed = 0¶
Default random seed.
- TrainingTestDataGenerator.default_test_data = 'test.data'¶
Default output file for the test dataset.
- TrainingTestDataGenerator.default_test_prop = 0.3¶
Default proportion of samples assigned to the test set.
- TrainingTestDataGenerator.default_training_data = 'training.data'¶
Default output file for the training dataset.
Static methods¶
- static TrainingTestDataGenerator.load(filename: str) Base¶
Load a serialized object from a file.
- Parameters:
filename (str) – The file name.
- Returns:
The loaded object
- Raises:
TypeError – If filename is not a valid file name
ValueError – If the filename extension is not
SERIALIZED_FILE_EXTENSION
Methods¶
- TrainingTestDataGenerator.dump(filename: str) None¶
Serialize this object and save it to a file.
- Parameters:
filename (str) – The file name.
- Raises:
TypeError – If filename is not a valid file name
ValueError – If the filename extension is not
SERIALIZED_FILE_EXTENSION
- abstract TrainingTestDataGenerator.get_dataset() Dataset¶
Get and validate the dataset.
Subclasses must implement this method to get a concrete dataset.
- Returns:
The dataset.
- Return type:
- Raises:
ValueError – If the dataset does not match the expected number of features, samples, or classes.
- TrainingTestDataGenerator.parse_args() None¶
Parse and validate command-line arguments.
- Raises:
SystemExit – If the command-line arguments are invalid or
--helpis requested.

