qxmt.datasets.generate.loader module#
- class qxmt.datasets.generate.loader.GeneratedDataLoader(task_type, generate_method, random_seed, params={})#
Bases:
object
This class loads the generated data and label. The loaded data and label are returned as numpy arrays (X and y). The dataset is generated by the specified task and method.
Supported task types: - classification - regression
Supported generate methods: - linear
Examples
>>> loader = GeneratedDataLoader(task_type="classification", generate_method="linear", random_seed=42) >>> X, y = loader.load() >>> loader = GeneratedDataLoader(task_type="regression", generate_method="linear", random_seed=42) >>> X, y = loader.load()
- Parameters:
task_type (str)
generate_method (str)
random_seed (int)
params (dict[str, Any])
- __init__(task_type, generate_method, random_seed, params={})#
Initialize the GeneratedDataLoader.
- Parameters:
task_type (str) – dataset task type
generate_method (str) – generate dataset method
random_seed (int) – random seed for reproducibility
params (dict[str, Any]]) – additional parameters for dataset generation
- Return type:
None
- load()#
Load dummy dataset. The dataset is generated by the specified task and method.
- Parameters:
task_type (str) – dataset task type. “classification” or “regression” is supported.
generate_method (str) – generate dataset method. “linear” is supported.
random_seed (int) – random seed for reproducibility.
params (dict[str, Any]]) – additional parameters for dataset generation.
- Raises:
ValueError – not supported task_type or generate_method
- Returns:
generated data and label
- Return type:
tuple[np.ndarray, np.ndarray]