liana.method.sp.SingleViewModel#

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

Base class for single view models. Subclasses should implement the fit method.

Parameters:
  • seed (int) – Pseudo-random number generator (PRNG) state seed.

  • kwargs – Other arguments used in a specific method. See the specific documentation in the corresponding child class.

seed#

The assigned initial state for the PRNG.

Type:

int

kwargs#

Keyword arguments passed to the fit function in a child class.

Type:

dict[str, Any]

model#

The model name.

Type:

str

predictions#

Contains the resulting predictions in array form.

Type:

np.ndarray

importances#

Contains the importance scores of the different predictors.

Type:

dict[str, np.ndarray]

Methods table#

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

Fit the model to the data and store the predictions and importances.

getdoc()

Methods#

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

Fit the model to the data and store the predictions and importances.

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.

Raises:

NotImplementedError – Base class method, children classes replace it with their own method.

SingleViewModel.getdoc() str | None#