Bug fixes
- Coherence: last document's words were silently skipped due to a wrong boundary (
w_rj = W
instead ofn_dw.indptr[d+1]). Could also cause out-of-bounds memory access when vocabulary size
exceeded total non-zeros. Now correct for all documents. - BTMClassifier mixed-case input: documents with capital letters or punctuation produced
all-zero topic vectors because raw whitespace splitting did not match the lowercased,
token-pattern-filtered vocabulary.fit()andtransform()now tokenize via the fitted
CountVectorizer's analyzer. set_params(vectorizer_params=None): crashed on the nextfit()withTypeError. The
constructor no longer rewritesNoneto{}.BTM.transform(): invalidinfer_typenow raisesValueErrorlisting valid options instead
of silently producing a memoryview assignment error.seed=0: previously fell back totime(NULL)(second-level granularity, so two models
created in the same second got identical seeds). Now uses OS entropy via
np.random.default_rng(None).
Performance
- Coherence: removed a redundant inner loop that re-ran the same idempotent check
Mtimes per
word. ~20× faster on the coherence hot path with defaultM=20.
API
BTMClassifier.fit()andfit_transform()now accept averboseparameter (defaultFalse).
Previously the tqdm progress bar was hardcoded on with no way to suppress it. Note: training is
now silent by default; passverbose=Trueto restore the progress bar.
Internal
- Removed dead code (
_parse_wordsinget_vectorized_docs, unusedtimecimport). - Added regression tests for the coherence boundary, mixed-case input,
set_params(vectorizer_params=None), and invalidinfer_type.
Full Changelog: v0.10.0...v0.11.0