Dummy Models

Dummy model implementations.

class openadmet.models.architecture.dummy.DummyClassifierModel(*, strategy: str = 'most_frequent', random_state: int | None = None, constant: int | str | None = None)[source]

Bases: DummyModelBase

Dummy classification model.

Common parameters for dummy models can be found at: https://scikit-learn.org/stable/api/sklearn.dummy.html

constant: int | str | None
mod_class

alias of DummyClassifier

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.

random_state: int | None
strategy: str
type: ClassVar[str] = 'DummyClassifierModel'
class openadmet.models.architecture.dummy.DummyModelBase[source]

Bases: PickleableModelBase

Base class for Dummy models, allows instantiation from parameters that are passable to the Dummy model classes.

build()[source]

Prepare the model.

mod_class: ClassVar[type]
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.

predict(X: ndarray, **kwargs) ndarray[source]

Predict using the model.

Parameters:
  • X (np.ndarray) – Featurized data to predict on

  • kwargs (dict) – Additional keyword arguments to pass to the predict method of the Dummy model

Returns:

Predictions from the model

Return type:

np.ndarray

train(X: ndarray, y: ndarray)[source]

Train the model.

Parameters:
  • X (np.ndarray) – Training data features

  • y (np.ndarray) – Training data labels

type: ClassVar[str]
class openadmet.models.architecture.dummy.DummyRegressorModel(*, strategy: str = 'mean', constant: float | None = None, quantile: float | None = None)[source]

Bases: DummyModelBase

Dummy regression model.

Common parameters for dummy models can be found at: https://scikit-learn.org/stable/api/sklearn.dummy.html

constant: float | None
mod_class

alias of DummyRegressor

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.

quantile: float | None
strategy: str
type: ClassVar[str] = 'DummyRegressorModel'