Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Casting to sparse matrix in project.py #1487

Open
jteijema opened this issue Jul 6, 2023 · 0 comments
Open

Casting to sparse matrix in project.py #1487

jteijema opened this issue Jul 6, 2023 · 0 comments
Assignees

Comments

@jteijema
Copy link
Member

jteijema commented Jul 6, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants