scikit-learn Training
Trainers for sklearn models.
- class openadmet.models.trainer.sklearn.SKLearnGridSearchTrainer(*, param_grid: dict = {})[source]
Bases: SKLearnSearchTrainer
Trainer for sklearn models with grid search.
- Variables:
param_grid (dict) – The parameter grid for grid search.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context: Any, /) → None
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Args:
self: The BaseModel instance. context: The context.
- param_grid: dict
- train(X: Any, y: Any)[source]
Train the model.
- Parameters:
-
- Returns:
The trained model.
- Return type:
ModelBase
- class openadmet.models.trainer.sklearn.SKLearnSearchTrainer[source]
Bases: SKLearnTrainer
Trainer for sklearn models with search.
- Variables:
search (Any) – The search object (e.g., GridSearchCV).
- build()[source]
Unused method for sklearn models.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context: Any, /) → None
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Args:
self: The BaseModel instance. context: The context.
- property search
Return search object (e.g., GridSearchCV).
- class openadmet.models.trainer.sklearn.SKLearnTrainer[source]
Bases: TrainerBase
Base trainer for sklearn models.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context: Any, /) → None
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Args:
self: The BaseModel instance. context: The context.
- class openadmet.models.trainer.sklearn.SKlearnBasicTrainer[source]
Bases: SKLearnTrainer
Basic trainer for sklearn models.
- build()[source]
Unused method for sklearn models.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context: Any, /) → None
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Args:
self: The BaseModel instance. context: The context.
- train(X: Any, y: Any)[source]
Train the model.
- Parameters:
X (Any) – Feature data.
y (Any) – Target data.
- Returns:
The trained model.
- Return type:
ModelBase