New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue in Optimal_Clusters_GMM #40
Comments
@carversh can you add a reproducible example? What is 'dat' that you use in 'Optimal_Clusters_GMM'? |
I can reproduce the error using the documentation example data and your parameter setting, require(ClusterR)
data(dietary_survey_IBS)
dat = dietary_survey_IBS[, -ncol(dietary_survey_IBS)]
dat = center_scale(dat)
opt_gmm = Optimal_Clusters_GMM(data = dat,
max_clusters = 10,
criterion = "AIC",
dist_mode = 'maha_dist',
seed_mode = 'random_subset',
km_iter = 10,
em_iter = 10,
var_floor = 1e-10,
plot_data = TRUE,
verbose = TRUE)
opt_gmm
# Error: $ operator is invalid for atomic vectors It seems that the error comes from the the following line class(res) = c("GMMCluster", 'Gaussian Mixture Models')
if I modify this line to class(res) = 'Gaussian Mixture Models'
then the function returns as expected. From what I understand it is related to "GMMCluster". The later appears in "predict.GMMCluster" and "print.GMMCluster" @vspinu do you happen to know why this error appears and is related to "GMMCluster"? You've added this additional class in #24 Can we simply omit it here and keep only 'Gaussian Mixture Models'? |
I have added "GMMCluster" to all those models which where classed with the old Let me PR to fix that. |
[Fix #40] Don't class the output of Optimal_Clusters_GMM
Thanks so much! |
Hi, I'm not sure exactly what the error is, however, I am using the Optimal_Clusters_GMM function and returning an error. When I do the same thing with the GMM function, everything works fine, however, I run into issues then optimizing.
Here is the function I'm using:
Optimal_Clusters_GMM(dat, max_clusters=10, criterion = 'BIC', dist_mode = 'maha_dist', seed_mode = 'random_subset', km_iter = 10, em_iter=10, var_floor = 1e-10, plot_data=T, verbose=T)
And here is the error message (note that all 10 iteration are completed:
The text was updated successfully, but these errors were encountered: