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
DataArrayobjects used as predictors with predictor names as keys, or axr.Datasetwhere each predictor is aDataArray. Each predictor must be 1D and containdim. One can also make predictions for multiple trajectories/scenarios at once, in this case, pass axr.DataTreewhere each leaf holds aDatasetwith 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 withonly.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 withexclude.
- Returns:
prediction (xr.Dataset | xr.DataTree) – Returns predictions in a Dataset or as DataTree if preds was a DataTree.