Description:
I encountered an issue while trying to use clf.fit()
and predict()
on a csr_matrix
input (from adata.X
) when running the following code:
doublets = clf.fit(adata.X).predict(p_thresh=1e-3, voter_thresh=0.5)
This throws the error:
AttributeError: 'csr_matrix' object has no attribute 'A'
Steps to Reproduce:
- Load a dataset into
adata
where adata.X
is in a sparse csr_matrix
format.
- Call
clf.fit(adata.X).predict(p_thresh=1e-3, voter_thresh=0.5)
.
Expected Behavior:
The method should handle sparse matrices properly or convert them internally to dense arrays if required.
Actual Behavior:
The error is raised because the sparse matrix (csr_matrix
) does not have an .A
attribute, which seems to be expected by the function.
Environment: