liana.method.sp.LinearModel#

class liana.method.sp.LinearModel(seed, **kwargs)#

Linear regression model using statsmodels.OLS for feature importances, and cross_val_predict with sklearn.LinearRegression for predictions. Inherits from SingleViewModel

Methods table#

fit(y, X, predictors[, k_cv])

Fits a Linear Model (LM) model.

getdoc()

Methods#

LinearModel.fit(y, X, predictors, k_cv=None)#

Fits a Linear Model (LM) model.

Parameters:
  • y (ndarray) – Target variable

  • X (ndarray) – Feature matrix

  • predictors (list[str]) – List of feature names

  • k_cv (int (default: None)) – Number of cross-validation folds. If None, no cross-validation is performed.

LinearModel.getdoc() str | None#