swiftemulator.mean_models.base module

A base model to be overloaded in further implementations.

class swiftemulator.mean_models.base.MeanModel[source]

Bases: object

A base mean model which describes the basic layout. Each function must be overloaded.

train(independent: numpy.ndarray, dependent: numpy.ndarray) None[source]

Trains the mean model to predict dependent(independent).

By convention, if there is an underlying model object, this should be stored in self.model.

Parameters
  • independent (np.ndarray) – Independent variables. Should be in the same format as is passed to george.

  • dependent (np.ndarray) – Dependent variables, to be predicted from the independent variables. Should be in the same format as is passed to george.

Raises

NotImplementedError – If not implemented.

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

Predicts dependent variables from independent variables, using the predictive model.

Parameters

independent (np.ndarray) – Independent variables to predict dependent variables from, in the same format as is passed to george.

Returns

dependent – Dependent variables that are in the same format that george expects.

Return type

np.ndarray

Raises
  • NotImplementedError – If not implemented

  • AttributeError – If the model is not trained.

property george_model: george.modeling.CallableModel

Get the george CallableModel instance that corresponds to this system. Returns a copy of the predict function associated with the current instance.

copy() swiftemulator.mean_models.base.MeanModel[source]

Copy self to a new version of the model. Required should you wish to re-use a version of this object later on, as otherwise the model parameter will be mutated.