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: 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[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.