pyPhenology.models.Model.score¶
-
Model.
score
(metric='rmse', doy_observed=None, to_predict=None, predictors=None)¶ Evaluate a prediction given observed doy values
Given no arguments this will return the RMSE on the dataset used for fitting (if fitting was done). To evaluate a new set of data set
to_predict
, andpredictors
as used inmodel.predict()
. The predictions from these will be evluated against the true values indoy_observed
.Metrics available are root mean square error (
rmse
) and AIC (aic
). For AIC the number of parameters in the model is set to the number of parameters actually estimated infit()
, not the total number of model parameters.- Parameters:
- metric : str, optional
- The metric used either ‘rmse’ for the root mean square error, or ‘aic’ for akaike information criteria.
- doy_observed : numpy array, optional
- The true doy values to evaluate with. This must be a numpy array the same length as the number of rows in to_predict
- to_predict : dataframe, optional
- pandas dataframe of site/year combinations to predict from the given predictor data. just like the observations dataframe used in fit() but (optionally) without the doy column
- predictors : dataframe, optional
- pandas dataframe in the format specific to this package
- Returns:
- The score as a float