Could anyone help me how to find the seed of the centroid in a random manner.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
The following code executes and gives the result.
code:
clear all
clc
centroids=2
dimensions = 2;
iterations = 10;
dataset_subset = 2;
load test1.mat
meas = meas(:,1+dataset_subset:dimensions+dataset_subset);
dataset_size = size (meas);
[idx,KMEANS_CENTROIDS] = kmeans(meas,centroids);
With respect to the above code the centroids is fixed to 2.
Could anyone help me to modify the code in such a way that the number of centroids needs to be selected in a random manner.
0 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Random Number Generation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!