Skip to content

voiage.metamodels.ActiveLearningMetamodel

A metamodel that uses active learning to iteratively improve its predictions.

fit([positional or keyword] self: None = None, [positional or keyword] x: ParameterSet = None, [positional or keyword] y: np.ndarray = None, [positional or keyword] x_pool: np.ndarray | None = None, [positional or keyword] y_pool: np.ndarray | None = None, [positional or keyword] n_iterations: int = 5) -> None

Fit the metamodel using active learning.

x : ParameterSet Initial training parameters. y : np.ndarray Initial training targets. x_pool : np.ndarray, optional Pool of unlabeled samples to query from. y_pool : np.ndarray, optional True labels for the pool (for simulation purposes). n_iterations : int, default=5 Number of active learning iterations.

Parameters:

  • self
  • x ParameterSet
  • y np.ndarray
  • x_pool np.ndarray | None (default: None)
  • y_pool np.ndarray | None (default: None)
  • n_iterations int (default: 5)

Returns: None

predict([positional or keyword] self: None = None, [positional or keyword] x: ParameterSet = None) -> np.ndarray

Predict using the actively learned metamodel.

x : ParameterSet The input parameters.

np.ndarray The predictions.

Parameters:

  • self
  • x ParameterSet

Returns: np.ndarray

score([positional or keyword] self: None = None, [positional or keyword] x: ParameterSet = None, [positional or keyword] y: np.ndarray = None) -> float

Return the coefficient of determination R^2 of the prediction.

x : ParameterSet The input parameters. y : np.ndarray The true target values.

float R^2 score.

Parameters:

  • self
  • x ParameterSet
  • y np.ndarray

Returns: float

rmse([positional or keyword] self: None = None, [positional or keyword] x: ParameterSet = None, [positional or keyword] y: np.ndarray = None) -> float

Return the root mean squared error of the prediction.

x : ParameterSet The input parameters. y : np.ndarray The true target values.

float RMSE.

Parameters:

  • self
  • x ParameterSet
  • y np.ndarray

Returns: float