Solver
solver_mixupvi_module(model, signature_latent_space, adata, layer, device='cpu')
Placeholder for MixupVI module solver.
Source code in src/pydeconv/model/solver/nn.py
solver_nnls(adata, signature_matrix, layer)
Solve the linear regression using non-negative least squares.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adata
|
AnnData
|
Anndata object containing the data. |
required |
signature_matrix
|
SignatureMatrix
|
Signature matrix object. |
required |
layer
|
str
|
Layer to use for the regressions. |
required |
Returns:
Name | Type | Description |
---|---|---|
coef_ |
ndarray
|
Coefficients of the linear regression. |
Source code in src/pydeconv/model/solver/linear.py
solver_nusvr(adata, signature_matrix, layer, norm=True, scale=False)
Solve the linear regression using ordinary least squares
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adata
|
AnnData
|
Anndata object containing the data |
required |
signature_matrix
|
SignatureMatrix
|
Signature matrice object |
required |
layer
|
str
|
Layer to use for the regression |
required |
norm
|
bool
|
If True, the data will be normalized to the range [-1, 1] |
True
|
scale
|
bool
|
If True, the data will be scaled to have zero mean and unit variance. |
False
|
Returns:
Name | Type | Description |
---|---|---|
coef_ |
ndarray
|
Coefficients of the linear regression |
Source code in src/pydeconv/model/solver/svm.py
solver_ols(adata, signature_matrix, layer)
Solve the linear regression using ordinary least squares.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adata
|
AnnData
|
Anndata object containing the data. |
required |
signature_matrix
|
SignatureMatrix
|
Signature matrix object. |
required |
layer
|
str
|
Layer to use for the regression. |
required |
Returns:
Name | Type | Description |
---|---|---|
coef_ |
ndarray
|
Coefficients of the linear regression. |
Source code in src/pydeconv/model/solver/linear.py
solver_rlr(adata, signature_matrix, layer)
Solve the linear regression using robust linear regression. and huber loss function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adata
|
AnnData
|
Anndata object containing the data. |
required |
signature_matrix
|
SignatureMatrix
|
Signature matrix object. |
required |
layer
|
str
|
Layer to use for the regression. |
required |
Returns:
Name | Type | Description |
---|---|---|
coef_ |
ndarray
|
Coefficients of the linear regression. |
Source code in src/pydeconv/model/solver/linear.py
solver_svr(adata, signature_matrix, layer)
Solve the linear regression using ordinary least squares
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adata
|
AnnData
|
Anndata object containing the data |
required |
signature_matrix
|
SignatureMatrix
|
Signature matrice object |
required |
layer
|
str
|
Layer to use for the regression |
required |
Returns:
Name | Type | Description |
---|---|---|
coef_ |
ndarray
|
Coefficients of the linear regression |
Source code in src/pydeconv/model/solver/svm.py
solver_torch_module(model, adata, layer, device='cpu')
Solve the deconvolution problem using a torch model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model
|
Module
|
The model to use for deconvolution. |
required |
adata
|
AnnData
|
Anndata object containing the data. |
required |
layer
|
str
|
Layer of the data to use for deconvolution. |
required |
device
|
str
|
Device to use for the computation, by default "cpu" |
'cpu'
|
Source code in src/pydeconv/model/solver/nn.py
solver_wls(adata, signature_matrix, layer, max_iter=1000, tol=0.01, dampened=None, solver_func=solver_nnls, parallel=False)
Solve the linear regression using Weighted Least Squares.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adata
|
AnnData
|
Anndata object containing the data. |
required |
signature_matrix
|
SignatureMatrix
|
Signature matrix object. |
required |
layer
|
str
|
Layer to use for the regression. |
required |
max_iter
|
int
|
Maximum number of iterations, by default 1000. |
1000
|
tol
|
float
|
Tolerance for the convergence, by default 0.01. |
0.01
|
dampened
|
Union[list, Literal['auto'], None]
|
Dampening constant for the weights. If None, no dampening is applied. If "auto", the dampening constant is calculated automatically, by default None. |
None
|
solver_func
|
Callable
|
Function to solve the linear regression, by default solver_nnls. |
solver_nnls
|
parallel
|
bool
|
Whether to run the solver in parallel, by default False. |
False
|
Returns:
Name | Type | Description |
---|---|---|
coef_ |
ndarray
|
Coefficients of the linear regression. |