Skip to content

Add Guassian Mixture Models to available clustering models #194

Closed
@nathaniel-johnson22

Description

@nathaniel-johnson22
install.packages(c("reprex", "sessioninfo"), repos = "http://cran.r-project.org")

Gaussian Mixture

I would like the ability to run gaussian mixture models using tidyclust. GMM allows clusters to be extracted assuming data is drawn from multiple gaussian distributions. Common implementations in R include the mclust

Specification Example

gmm_spec <- gaussian_mixture() %>% parsnip::set_engine("Mclust")

Fit and Prediction would work similar to kmeans, mclust produces both discrete classification (model$classification) and probabilities (a matrix: model$z)

Fit and Predict Example

gmm_fit <- gmm_spec %>% fit(~ bill_length_mm + bill_depth_mm, data = penguins )

new_penguin <- tibble(bill_length_mm = 42,  bill_depth_mm = 17)

kmeans_fit %>%  predict(new_penguin)

Currently, parsnip does not allow custom-built unsupervised models. An alternative would be a similar framework in tidyclust that extends parsnip to allow this.

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