Skip to content

Does GMM have the option to get the cluster probability? #372

@rickbeeloo

Description

@rickbeeloo

Hey!

After doing the fit:

// We fit the model from the dataset setting some options
    let gmm = GaussianMixtureModel::params(n_clusters)
                .n_runs(10)
                .tolerance(1e-4)
                .with_rng(rng)
                .fit(&dataset).expect("GMM fitting");

    // Then we can get dataset membership information, targets contain **cluster indexes**
    // corresponding to the cluster infos in the list of GMM means and covariances
    let blobs_dataset = gmm.predict(dataset);

Can I get the probability of it belonging to one of the clusters? It will assign it to the cluster with the highest probability (I assume) however, I want to only assign if the probability is higher than a specific threshold.

I'm not familiar with linfa at all, so perhaps there is a standard way of doing this.

Thanks for building all this!

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions