mesmer.stats.LinearRegression.predict

mesmer.stats.LinearRegression.predict#

LinearRegression.predict(predictors, *, exclude=None, only=None)#

Predict using the linear model.

Parameters:
  • predictors (dict of xr.DataArray | xr.Dataset | xr.DataTree) – Either a dict of DataArray objects used as predictors with predictor names as keys, or a xr.Dataset where each predictor is a DataArray. Each predictor must be 1D and contain dim. One can also make predictions for multiple trajectories/scenarios at once, in this case, pass a xr.DataTree where each leaf holds a Dataset with the predictors for a scenario.

  • exclude (str or set of str, default: None) – Set of variables to exclude in the prediction. May include "intercept" to initialize the prediction with 0. Mutually exclusive with only.

  • only (str or set of str, default: None) – Set of variables to include in the prediction. May include "intercept" otherwise the prediction is initialized with 0. Mutually exclusive with exclude.

Returns:

prediction (xr.Dataset | xr.DataTree) – Returns predictions in a Dataset or as DataTree if preds was a DataTree.