curvefit.core.core_model.Model
Base class for a curvefit model
Add description here.
Arguments
param_set (curvefit.core.parameter.ParameterSet)
curve_fun (Callable)
: function fromcurvefit.core.functions
for the parametric function to fitloss_fun (Callable)
: function fromcurvefit.core.functions
for the loss function
Attributes
self.data_inputs (curvefit.models.base.DataInputs)
: data inputs that have been converted during data fitting -- helper for the objective function
Methods
objective
Returns a function that can be called in a Solver
that is the
objective function given the current variables and data.
x (np.array)
: an array of variable values that can be converted to parameters, these will be the parameters that the objective function is evaluated atdata (Tuple[pd.DataFrame, DataSpecs])
: the input data frame to be fit, and data specifications object
get_params
Wrapper for effects2params
to convert the values of
x
(the variables) into parameters for the model.
x (np.array)
: an array of variable values that can be converted to parameters
predict
Create predictions given some variable values x
and at some times t
.
Can optionally pass a different functional form as long as it is in the same
family (e.g. Gaussian).
x (np.array)
: an array of variable values that can be converted to parameterst (np.array)
: times to evaluate the functionpredict_fun (Callable)
: function fromcurvefit.core.functions
is_multi_groups (bool)
: whether or not the model was fit on data for multiple groups
convert_inputs
Convert a data frame and specifications into inputs for the objective function of the model.
data (Tuple[pd.DataFrame, DataSpecs])
: the input data frame to be fit, and data specifications object