swiftemulator.mean_models.polynomial module

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

class swiftemulator.mean_models.polynomial.PolynomialMeanModel(degree: int = 1)[source]

Bases: swiftemulator.mean_models.base.MeanModel

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

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

Parameters

degree (int, optional) – Maximal degree of the polynomial surface, default 1 (linear in each parameter).

degree: int
model: Optional[Union[sklearn.linear_model._base.LinearRegression, sklearn.linear_model._coordinate_descent.Lasso]] = None
train(independent: numpy.ndarray, dependent: numpy.ndarray) None[source]

Train the model. See MeanModel for more information.

predict(independent: numpy.ndarray) numpy.ndarray[source]

Predict using the model. See MeanModel for more information.