Closed
Description
Tracks roadmap rank 80: HashingVectorizer.transform.
Implementation evidence
PR #318 removes a redundant dense zeroing pass from hashing_vectorizer_transform. matrix_new is calloc-backed, so explicitly clearing every n_samples × n_features cell was pure duplicate work. The optimized path now computes one row base and accumulates token counts directly into row-major Matrix.data, making post-allocation work scale with observed token count rather than hash-space width.
A focused regression/benchmark fixture covers:
- collision accumulation;
- negative-token hash normalization;
- untouched zero columns;
- identical old-vs-new sparse workloads for A/B timing.
Validation evidence:
- exact source/test passed the complete 34/34 tests+examples suite;
- canonical benchmark/parity gate passed;
- native wheel build and Python API tests passed;
- scaled self-baseline performance gate passed;
- rebased head also passed syntax, canonical parity, package, and the new three-sample median self-baseline gate.
The final rebase only incorporates main's #324 workflow change (freeze generated evidence on main), not source/runtime changes.
Metadata
Metadata
Assignees
Labels
No labels
Activity
perf(feature-extraction): make HashingVectorizer token-scaled (#289)
perf(feature-extraction): make HashingVectorizer token-scaled (#289)
Make HashingVectorizer.transform scale with token count (#289)