pyPhenology.models.Model.fit

Model.fit(observations, predictors, loss_function='rmse', method='DE', optimizer_params='practical', verbose=False, debug=False, **kwargs)

Estimate the parameters of a model

Parameters:
observations : dataframe
pandas dataframe of phenology observations
predictors : dataframe
pandas dataframe of associated predictor variables such as temperature, precipitation, and day length

loss_function : str, or function

A string for built in loss functions (currently only ‘rmse’), or a customized function which accpepts 2 arguments. obs and pred, both numpy arrays of the same shape

method : str
Optimization method to use. Either ‘DE’ or ‘BF’ for differential evolution or brute force methods.
optimizer_params : dict | str
Arguments for the scipy optimizer, or one of 3 presets ‘testing’, ‘practical’, or ‘intensive’.
verbose : bool
display progress of the optimizer
debug : bool
display various internals