Skip to content

betula-cluster v0.1.4

Choose a tag to compare

@github-actions github-actions released this 04 Jul 10:55

Added

  • MapperGraph.persistence_diagram / MapperGraph.persistence(filtration=…) — 0-D persistent homology
    of the Mapper nerve by single-linkage union-find (elder rule, O(E log E), pure Rust). Two
    filtrations: "overlap" (the 1 − edge_overlap Bhattacharyya gap — a finite bar's death is the depth
    of a bottleneck, ranking the boolean bridges) and "lens" (the lens sublevel diagram). Essential
    connected-component classes carry inf death.
  • Greedy weighted k-means++ init (scikit-learn's default): lower-inertia, lower-variance seeds at
    ~ln k× the negligible init cost over the leaves.
  • objective="dbcv" for tune — Density-Based Clustering Validation (Moulavi et al. 2014, in
    [-1, 1]). Unlike the convex Calinski-Harabasz / Davies-Bouldin metrics (which penalise correct
    non-convex partitions), DBCV validates variable-density / non-convex clusters, so it is the right
    selection metric for the HDBSCAN-CF and DbStream density heads. NumPy-only, computed over a
    subsample.

Changed

  • fit_predict_sparse / the _core CSR entry points now cap n_features (MAX_SPARSE_FEATURES) and
    validate CSR arrays through the pure-Rust sparse::validate_csr, closing an unbounded-allocation DoS
    where a hostile caller could force an ~8 EB allocation with a single-nonzero row.
  • Docs reconciled to the current suite: 172-case Python suite, 147 Rust tests (143 unit + 4
    integration under default features; the python / persistence / cli surfaces add more, 155 total).

Tests

  • Mutation-testing infrastructure (cargo-mutants scoped to the CF math core, mutmut for the Python
    wrapper, a weekly non-blocking workflow) plus a CSR-fuzzing proptest and the two coverage gaps it
    surfaced (the CF-tree absorption boundary, exact tune-metric values).