Description Usage Arguments Details Value Author(s) Examples

View source: R/clustering_functions.R

Prediction function for a Gaussian Mixture Model object

1 | ```
predict_GMM(data, CENTROIDS, COVARIANCE, WEIGHTS)
``` |

`data` |
matrix or data frame |

`CENTROIDS` |
matrix or data frame containing the centroids (means), stored as row vectors |

`COVARIANCE` |
matrix or data frame containing the diagonal covariance matrices, stored as row vectors |

`WEIGHTS` |
vector containing the weights |

This function takes the centroids, covariance matrix and weights from a trained model and returns the log-likelihoods, cluster probabilities and cluster labels for new data.

a list consisting of the log-likelihoods, cluster probabilities and cluster labels.

Lampros Mouselimis

1 2 3 4 5 6 7 8 9 | ```
data(dietary_survey_IBS)
dat = as.matrix(dietary_survey_IBS[, -ncol(dietary_survey_IBS)])
dat = center_scale(dat)
gmm = GMM(dat, 2, "maha_dist", "random_subset", 10, 10)
# pr = predict_GMM(dat, gmm$centroids, gmm$covariance_matrices, gmm$weights)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.