swiftemulator.mean_models.base module
A base model to be overloaded in further implementations.
- class swiftemulator.mean_models.base.MeanModel[source]
Bases:
objectA 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
georgeexpects.- Return type
np.ndarray
- Raises
NotImplementedError – If not implemented
AttributeError – If the
modelis not trained.
- property george_model: george.modeling.CallableModel
Get the
georgeCallableModelinstance 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
modelparameter will be mutated.