Ensemble Base Classes

Base class for ensemble models.

class openadmet.models.active_learning.ensemble_base.EnsembleBase(*, models: list = [])[source]

Bases: ModelBase

Base class for ensemble models.

Variables:
  • type (ClassVar[str]) – The type of the ensemble model.

  • models (list) – The list of models in the ensemble.

  • _calibration_model_save_name (ClassVar[str]) – The name of the calibration model save file.

build()[source]

Is here as placeholder, as the committee will be built from provided models.

from_params()[source]

Is here as placeholder.

This method doesn’t really make sense for this class, as it is instantiated from already-trained models or from the train method.

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.

models: list
property n_models

Get the number of models in the ensemble.

type: ClassVar[str] = 'EnsembleBase'
openadmet.models.active_learning.ensemble_base.get_ensemble_class(ensemble_type)[source]

Get the ensemble class.