Skip to content

[CI only] Vectorize TFIDF.transform_many - #1

Open
Fazel94 wants to merge 2 commits into
ci-basefrom
vectorize-tfidf-minibatch
Open

[CI only] Vectorize TFIDF.transform_many#1
Fazel94 wants to merge 2 commits into
ci-basefrom
vectorize-tfidf-minibatch

Conversation

@Fazel94

@Fazel94 Fazel94 commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Internal self-PR to run CI on the fork. Vectorizes transform_many + pins numpy for the mypy hook. Not for merge.

Fazel94 added 2 commits June 23, 2026 12:40
Builds the document-term count matrix once and applies the tf / idf / L2 steps with scipy.sparse diagonal scaling, instead of computing the weights per document in Python. Output is unchanged (the existing parity tests, including the sklearn one, still pass), but it scales much better on large corpora: on 20 newsgroups (~11k docs) the count-matrix build lands roughly on par with sklearn's whole fit_transform.
The mypy pre-commit hook installed numpy unpinned, so CI pulled a newer numpy whose type stubs use the 3.12 'type' statement, which mypy rejects under --python-version=3.11 (the run aborts on the first such stub). Pin it to 2.4.3, the version already in uv.lock, matching the existing 'same as uv.lock' convention for ruff/mypy.
@Fazel94
Fazel94 force-pushed the vectorize-tfidf-minibatch branch 2 times, most recently from ae3ba7e to b70ae61 Compare June 25, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant