mesmer.stats.LinearRegression.fit

mesmer.stats.LinearRegression.fit#

LinearRegression.fit(predictors, target, dim, weights=None, fit_intercept=True)#

Fit a linear model

Parameters:
  • predictors (dict of xr.DataArray | DataTree | xr.Dataset) – A dict of DataArray objects used as predictors or a DataTree, holding each predictor in a leaf. Each predictor must be 1D and contain dim. If predictors is a xr.Dataset, it must have each predictor as a DataArray.

  • target (xr.DataArray) – Target DataArray. Must be 2D and contain dim.

  • dim (str) – Dimension along which to fit the polynomials.

  • weights (xr.DataArray, default: None.) – Individual weights for each sample. Must be 1D and contain dim.

  • fit_intercept (bool, default=True) – Whether to calculate the intercept for this model. If set to False, no intercept will be used in calculations (i.e. data is expected to be centered).