필터 지우기
필터 지우기

K-means: see the initial centroids

조회 수: 1 (최근 30일)
Phu Lai
Phu Lai 2016년 12월 2일
댓글: Massimo Zanetti 2016년 12월 6일
Hi everyone,
Is it possible to see the randomly selected initial centroids when using the built-in kmeans function? I want to keep track of the centroids in each iteration.
Thanks.

채택된 답변

Massimo Zanetti
Massimo Zanetti 2016년 12월 2일
Yes it is possible.
kmeans allows you to set option parameters via the statset function. In the help page kmeans there some examples on how using stateset.
Set the parameter 'OutputFcn' as shown in this tutorial, for displaying iteration results in iterative solvers: https://it.mathworks.com/help/matlab/math/output-functions.html
  댓글 수: 4
Phu Lai
Phu Lai 2016년 12월 6일
Thank you. I ended up following that approach. Also, do you know how to see the first initial centroids? (Let's say, C{0} in your example)
Massimo Zanetti
Massimo Zanetti 2016년 12월 6일
Nope.. I have tried setting 'MaxIter'=0, but it seems it is the same as setting 'MaxIter'=1. The kmeans function is a black box :(

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by