To assess the performance of k-means adapted to supervised classification with different values of k, you can use the following approach:
Here's an example code that demonstrates this approach:
main.m942 chars29 lines
Note that load_dataset()
, split_dataset()
, and assign_labels()
are helper functions that you need to define based on the format of your data.
gistlibby LogSnag