Matlab kmeans:failed to converge in Iterations__matlab

Source: Internet
Author: User

Encountered this problem, because the Kmeans function in MATLAB by default, the iterative steps are 100 times, and you may be because of the need for clustering data is relatively large, resulting in your iteration 100 steps have not yet converged. You can view parameter information through the following command:

Help Kmeans

Here is some of its functional explanations:

' Options '-options for the iterative algorithm used to minimize the
Fitting criterion, as created by Statset. Choices of Statset
Parameters are:

' Display '-level of Display output. Choices are ' off ', (the
Default), ' ITER ', and ' final '.
' Maxiter '-Maximum number of iterations allowed. Default is 100.


Solution:

Add parameter settings in the Kmeans function where ' display ' shows the number of steps for the iteration, ' maxiter ' sets the number of steps for the iteration:

opts = Statset (' Display ', ' final ', ' Maxiter ', 1000);
[idx, CTRs] = Kmeans (Xl ', K, ' Options ', opts);


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.