Description Usage Arguments Value Examples
View source: R/kmeans_label_rematch.R
match the true label based on the label existed
1 | kmeans_label_rematch(Y_train, Y_actual, Y_test = NULL, Y_test_actual = NULL)
|
Y_train |
label got from the kmeans_cluster from training data |
Y_actual |
the actual label |
Y_test |
predict label for testing data (optional) |
Y_test_actual |
the actual test label(optional) |
the vector of matched label and training_accuracy. If Y_test_actual and Y_test are not null, return the matched test label and testing accuracy respectively.
1 2 3 4 5 6 7 8 | X1 = c(1,3,2,2,1,2,2)
X2 = c(2,5,1,1,1,1,1)
# Function will determine match label based on majority vote
# Cluster label 1 will match 2
# cluster label 3 will match 5
# Cluster label 2 will match 1
kmeans_label_rematch(X1,X2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.