2.13.3.2 kmeans(Pro)


Menu Information

Statistics: Multivariate Analysis: K-Means Cluster Analysis

Brief Information

Perform K-Means clustering.

Additional Information

This feature is for OriginPro only.

Minimum Origin Version Required: 8.6

Command Line Usage

1. kmeans ir:=1:end num:=3;

2. kmeans ir:=1:end num:=3 plot:=1 iy:=(1,3);

3. kmeans ir:=1:4 specify:=1 iinitial:=[book2]1!1:4;

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Variables ir

Input

Range

<active>
Observations to cluster.
Number of Clusters num

Input

int

2
Number of clusters for observation classification. This option is not available when using Specify Initial Cluster Centers.
Specify Initial Cluster Centers specify

Input

int

0
Specify Initial Cluster Centers (1), or use Number of Clusters (0)
Initial Cluster Centers iinitial

Input

Range

Initial cluster centers specified by users
Maximum Number of Iterations iter

Input

int

10
Specify the maximum number of iterations allowed in the analysis.
Initial Cluster Centers oinitial

Input

int

1
Specify whether (1) or not (0) to report initial cluster centers.
ANOVA anova

Input

int

0
Specify whether (1) or not (0) to report ANOVA.
Cluster Membership member

Input

int

1
Specify whether (1) or not (0) to output cluster membership.
Distance from Cluster distance

Input

int

0
Specify whether (1) or not (0) to calculate the distance between each observation and its corresponding cluster center.
Group Graph plot

Input

int

0
Specify whether (1) or not (0) to create group graph.
Select Variables for Plot iy

Input

Range

Range contains the data to be grouped for group graph, which is only available when plot is 1.
  • X Range
    Select the range as x axis for the group graph.
  • Y Range
    Select the range as y axis for the group graph.
K-Means Report rt

Output

ReportTree

[<input>]<new>
Specify the location of output report tree.
Cluster Membership rd

Output

ReportData

<new>
Specify the location for the cluster membership and distance from cluster.
Plot Data rdplot

Output

ReportData

<new>
Specify the sheet for plot data. This variable is hidden in the dialog.

Description

This function performs the K-Means Cluster Analysis on range data. For more information, see the Cluster Analysis.

Examples

  1. Import the data file \Samples\Statistics\Fisher's Iris Data.dat .
  2. Run the script.
kmeans ir:=1:4 num:=3 -r 2;

Algorithm

See the algorithm of K-Means Cluster Analysis.

References

See the reference of Cluster Analysis.

Related X-Functions

pca, hcluster, discrim