Skip to content

Roadmap #39: optimize BisectingKMeans.transform #248

Closed as not planned
Closed as not planned

Description

@godofecht

Tracks rank 39 in benchmarks/OPTIMIZATION_ROADMAP.md: BisectingKMeans.transform. Complete the roadmap optimization hypothesis with sklearn-parity-gated benchmark evidence, then update roadmap evidence/disposition before closing.

Activity

  1. godofecht commented on Aug 18, 2026

    @godofecht
    OwnerAuthor

    Closing as a no-op: there is nothing to optimize, because BisectingKMeans.transform has no Flow implementation.

    What I checked

    lib/scikit/cluster.flow defines exactly two BisectingKMeans entry points:

    1510:export struct BisectingKMeans {
    1520:export function bisecting_kmeans_fit(X: Matrix, n_clusters: i32, max_iter: i32, seed: i32) -> BisectingKMeans {
    1630:export function bisecting_kmeans_free(model: BisectingKMeans) -> void {
    

    There is no bisecting_kmeans_transform, and no bisecting_kmeans_predict either. A repository-wide search finds no caller of any such function, and the Python package under python/ has no BisectingKMeans binding. benchmarks/parity_contract.json has no BisectingKMeans row.

    Why the roadmap row exists anyway

    Rank 39 comes from benchmarks/sklearn_execution_inventory.json, which enumerates sklearn's own public methods. Every row from rank 21 down carries the same tied score of 46.5, a blank observed-speedup column and one templated hypothesis string. The row records that sklearn has a BisectingKMeans.transform. It is not evidence that flow-scikit has one.

    Writing bisecting_kmeans_transform would be new API surface rather than an optimization, and there is no before number to measure against. If the method is wanted, it belongs in a feature issue. Note that when it is written it should reuse blas_matmat_nt and the squared-euclidean expansion added for kmeans_transform in #332 rather than growing a second copy of that kernel: a BisectingKMeans model stores its centroids in the same ptr<ptr<f32>> layout KMeans does, so the same packing and sgemm applies unchanged.

    Related work in the same file

    The other four issues in this batch were handled as follows:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions