code in R language

Asked

Viewed 73 times

0

Can anyone explain to me what the code below performs?

cluster <- ml_kmeans(variaveis_clusters_tratado, CODCLI ~ ., k = 5)                         
clusters <- ml_predict(cluster, variaveis_clusters_tratado)

1 answer

0

The line cluster <- ml_kmeans(variaveis_clusters_tratado, CODCLI ~ ., k = 5) creates a K-MEANS template with the dataset data variaveis_clusters_tratado, following the formula CODCLI ~ ., with 5 clusters, that is, k=5.

The line clusters <- ml_predict(cluster, variaveis_clusters_tratado) tries to predict the values of variaveis_clusters_tratado using the model that was created in the first line, that is, the clusters.

At the same time that it does this, this line superimposes on the memory of the R the model created. That is, it uses the template and then replaces it with the result of the prediction, which will probably be a dataframe.

  • thanks for the help!!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.