swiftemulator.mean_models.linear module

A basic linear model based on the scikit-learn multidimensional mean model.

class swiftemulator.mean_models.linear.LinearMeanModel(lasso_model_alpha: float = 0.0)[source]

Bases: MeanModel

A linear mean model; fits a linear model to the multidimensional parameter space.

Under the hood, this uses the sklearn.linear_model.lm.

Parameters:

lasso_model_alpha (float, optional) – alpha for the Lasso model. If this is zero (the default) we fit a basic linear regression model is used for performance reasons.

lasso_model_alpha: float
model: Optional[Union[LinearRegression, Lasso]] = None
train(independent: ndarray, dependent: ndarray) None[source]

Train the model. See MeanModel for more information.

predict(independent: ndarray) ndarray[source]

Predict using the model. See MeanModel for more information.