cellrank.ul.models.SKLearnModel¶
-
class
cellrank.ul.models.
SKLearnModel
(adata, model, weight_name=None, ignore_raise=False)[source]¶ Wrapper around
sklearn.base.BaseEstimator
.- Parameters
adata¶ (
anndata.AnnData
) – Annotated data object.model¶ (
BaseEstimator
) – Instance of the underlyingsklearn
estimator, such assklearn.svm.SVR
.weight_name¶ (
Optional
[str
]) – Name of the weight argument formodel
.fit
. If None, to determine it automatically. If and empty string, no weights will be used.ignore_raise¶ (
bool
) – Do not raise an exception if weight argument is not found in the fitting function ofmodel
. This is useful in case when weight is passed in**kwargs
and cannot be determined from signature.
Attributes
Annotated data object.
Array of shape (n_samples, 2) containing the lower and upper bounds of the confidence interval.
The underlying
sklearn.base.BaseEstimator
.Whether the model is prepared for fitting.
Filtered weights of shape (n_filtered_cells,) used for fitting.
Unfiltered weights of shape (n_cells,).
Filtered independent variables of shape (n_filtered_cells, 1) used for fitting.
Unfiltered independent variables of shape (n_cells, 1).
Filtered independent variables used when calculating default confidence interval, usually same as
x
.Independent variables of shape (n_samples, 1) used for prediction.
Filtered dependent variables of shape (n_filtered_cells, 1) used for fitting.
Unfiltered dependent variables of shape (n_cells, 1).
Filtered dependent variables used when calculating default confidence interval, usually same as
y
.Prediction values of shape (n_samples,) for
x_test
.Methods
confidence_interval
([x_test])Calculate the confidence interval.
copy
()Return a copy of self.
default_confidence_interval
([x_test])Calculate the confidence interval, if the underlying
model
has no method for it.fit
([x, y, w])Fit the model.
plot
([figsize, same_plot, hide_cells, perc, …])Plot the smoothed gene expression.
predict
([x_test, key_added])Run the prediction.
prepare
(gene, lineage[, backward, …])Prepare the model to be ready for fitting.
read
(fname)Deserialize self from a file.
write
(fname[, ext])Serialize self to a file.