ertk.train.ModelConfig

class ertk.train.ModelConfig(type: str = '???', config: ~typing.Any | None = None, args: ~typing.Dict[str, ~typing.Any] = <factory>, args_path: str | None = None, param_grid: ~typing.Dict[str, ~typing.Any] = <factory>, param_grid_path: str | None = None)

Bases: ERTKConfig

Class to hold model configuration.

__init__(type: str = '???', config: ~typing.Any | None = None, args: ~typing.Dict[str, ~typing.Any] = <factory>, args_path: str | None = None, param_grid: ~typing.Dict[str, ~typing.Any] = <factory>, param_grid_path: str | None = None) None

Methods

__init__([type, config, args, args_path, ...])

Inherited Methods

from_config(config)

Create config object from any compatible config.

from_file(path[, override])

Create config from YAML file and optionlly override some values.

merge_with_args([args])

Merge config with command-line arguments.

to_dictconfig()

Convert config to DictConfig.

to_file(path)

Write config to YAML file.

to_string()

Generate YAML string representation of config.

Attributes

args_path

Path to a YAML file containing model arguments.

config

Model configuration.

param_grid_path

Path to a YAML file containing a parameter grid for hyperparameter search.

type

Model type.

args

Model arguments.

param_grid

Parameter grid for hyperparameter search.

args: Dict[str, Any]

Model arguments. These are passed to the model class constructor as keyword arguments.

args_path: str | None = None

Path to a YAML file containing model arguments. These are passed to the model class constructor as keyword arguments.

config: Any = None

Model configuration. This is passed to the model class constructor.

param_grid: Dict[str, Any]

Parameter grid for hyperparameter search. This is passed to scikit-learn’s GridSearchCV class.

param_grid_path: str | None = None

Path to a YAML file containing a parameter grid for hyperparameter search. This is passed to scikit-learn’s GridSearchCV class.

type: str = '???'

Model type. This is used to determine which model class to instantiate.