asreview / asreview

Active learning for systematic reviews

Home Page:https://asreview.ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Casting to sparse matrix in project.py

jteijema opened this issue · comments

https://github.com/asreview/asreview/blob/25ce8540a9c7e006c100b0da3617bc342c3597d3/asreview/project.py#L390C1-L397C14

if isinstance(feature_matrix, np.ndarray):
    feature_matrix = csr_matrix(feature_matrix)
if not isinstance(feature_matrix, csr_matrix):
    raise ValueError(
        "The feature matrix should be convertible to type "
        "scipy.sparse.csr.csr_matrix."
    )

We're casting all feature matrices to sparse matrix. This might be inefficient in some cases when compared to using a dense matrix.

Why was this format chosen?