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 Any

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 fitted estimator, whose type depends on the subclass.

Type:

object

predictions#

Contains the resulting predictions in array form.

Type:

numpy.ndarray

importances#

Contains the importance scores of the different predictors.

Type:

dict[str, float]

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 | None (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.

Return type:

None

SingleViewModel.getdoc() str | None#