Oracle Data Mining Java API Reference
10g Release 1 (10.1)

B12276-01

oracle.dmt.odm.settings.algorithm
Class KMeansAlgorithmSettings

java.lang.Object
  |
  +--oracle.dmt.odm.MiningObject
        |
        +--oracle.dmt.odm.settings.algorithm.MiningAlgorithmSettings
              |
              +--oracle.dmt.odm.settings.algorithm.ClusteringAlgorithmSettings
                    |
                    +--oracle.dmt.odm.settings.algorithm.KMeansAlgorithmSettings
All Implemented Interfaces:
java.io.Serializable

public class KMeansAlgorithmSettings
extends ClusteringAlgorithmSettings

An instance of KMeansAlgorithmSettings is used to specify settings for the KMeans clustering algorithm. It allows a knowledgeable user to fine tune algorithm parameters. Generally, not all parameters must be specified, however, those specified are taken into account by the underlying DMS. ODM 9.2.0 implements a hierarchical version of the K-Means algorithm. The tree is grown one node at the time. The node with the largest distortion (sum of distance to the node's centroid) is split to increase the size of the tree until the desired number of clusters is reached.

Since:
9.2.0
See Also:
Serialized Form

Constructor Summary
KMeansAlgorithmSettings()
          Creates a KMeansAlgorithmSettings default settings object.
KMeansAlgorithmSettings(float error, DistanceFunction distanceFunction)
           
KMeansAlgorithmSettings(int iterations, DistanceFunction distanceFunction)
           
KMeansAlgorithmSettings(int iterations, float error, DistanceFunction distanceFunction)
          Creates a KMeansAlgorithmSettings object with the maximum number of K-Means iterations between splits set to iterations, the minimum percentual change in error between K-Means iterations set to error, and the distance function to be used to train a K-Means set to distanceFunction.

 

Method Summary
 DistanceFunction getDistanceFunction()
          Returns the DistanceFunction specified by a KMeansAlgorithmSettings object to train a K-Means ClusteringModel.
 int getMaxNumberOfIterations()
          Returns the maxNumberOfIterations specified by a KMeansAlgorithmSettings object to train a K-Means ClusteringModel.
 float getMinimumErrorTolerance()
          Returns the minimumErrorTolerance specified by a KMeansAlgorithmSettings object to train a K-Means ClusteringModel.
 ClusteringStoppingCriterion getStopCriterion()
           
 void setDistanceFunction(DistanceFunction distanceFunction)
          Sets the distance function to be used to train a K-Means ClusteringModel.
 void setMaxNumberOfIterations(int maxIter)
          Sets the maximum number of K-Means iterations between splits while training a K-Means ClusteringModel.
 void setMinErrorTolerance(float minError)
          Sets the minimum percentual change in error between K-Means iterations to consider that K-Means has converged.
 void setStopCriterion(ClusteringStoppingCriterion stopCriterion)
           

 

Methods inherited from class oracle.dmt.odm.settings.algorithm.MiningAlgorithmSettings
getMiningAlgorithm, getMiningAlgorithmName

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

KMeansAlgorithmSettings

public KMeansAlgorithmSettings(int iterations,
DistanceFunction distanceFunction)
                        throws InvalidArgumentException
Throws:
InvalidArgumentException -

KMeansAlgorithmSettings

public KMeansAlgorithmSettings(float error,
DistanceFunction distanceFunction)
                        throws InvalidArgumentException
Parameters:
error - Minimum error tolerance. Recommended value: 0.05
Setting closer to .005 builds them model more slowly, but to .01 builds model faster, but perhaps with less accuracy.
distanceFunction - Distance function
Throws:
InvalidArgumentException -

KMeansAlgorithmSettings

public KMeansAlgorithmSettings(int iterations,
                               float error,
DistanceFunction distanceFunction)
                        throws InvalidArgumentException
Creates a KMeansAlgorithmSettings object with the maximum number of K-Means iterations between splits set to iterations, the minimum percentual change in error between K-Means iterations set to error, and the distance function to be used to train a K-Means set to distanceFunction. iterations is a number between 1 and 100. error is a number between 0 and 1. Training stops after either the change in error between two consecutive iterations is less than error or the maximum number of iterations over the data in the buffer is greater than iterations.
Throws:
InvalidArgumentException -

KMeansAlgorithmSettings

public KMeansAlgorithmSettings()
Creates a KMeansAlgorithmSettings default settings object.
Method Detail

getMinimumErrorTolerance

public float getMinimumErrorTolerance()
Returns the minimumErrorTolerance specified by a KMeansAlgorithmSettings object to train a K-Means ClusteringModel. The minimumErrorTolerance setting controls the minimum percentual change in error between K-Means iterations to considered that K-Means has converged. minimumErrorTolerance is a number between 0 and 1.
Returns:
Minimum error tolerance

getDistanceFunction

public DistanceFunction getDistanceFunction()
Returns the DistanceFunction specified by a KMeansAlgorithmSettings object to train a K-Means ClusteringModel.
Returns:
DistanceFunction for ClusteringModel training.

getStopCriterion

public ClusteringStoppingCriterion getStopCriterion()
Returns:
ClusteringStoppingCriterion for ClusteringModel training.

getMaxNumberOfIterations

public int getMaxNumberOfIterations()
Returns the maxNumberOfIterations specified by a KMeansAlgorithmSettings object to train a K-Means ClusteringModel. The maxNumberOfIterations setting controls the maximum number of K-Means iterations between splits while training a K-Means ClusteringModel. maxNumberOfIterations is a number between 1 and 100.
Returns:
Maximum number of iterations between splits

setMaxNumberOfIterations

public void setMaxNumberOfIterations(int maxIter)
                              throws InvalidArgumentException
Sets the maximum number of K-Means iterations between splits while training a K-Means ClusteringModel. maxIter is a number between 1 and 100.
Parameters:
maxIter - Maximum number of iterations
Throws:
InvalidArgumentException - when maxIter > 100 or maxIter < 1.

setMinErrorTolerance

public void setMinErrorTolerance(float minError)
                          throws InvalidArgumentException
Sets the minimum percentual change in error between K-Means iterations to consider that K-Means has converged. minError is a number between 0 and 1.
Parameters:
minError - Minimum percentual change in error
Throws:
InvalidArgumentException - when minError > 1 or minError < 0

setDistanceFunction

public void setDistanceFunction(DistanceFunction distanceFunction)
Sets the distance function to be used to train a K-Means ClusteringModel.
Parameters:
distanceFunction - Distance function used to train a K-Means ClusteringModel

setStopCriterion

public void setStopCriterion(ClusteringStoppingCriterion stopCriterion)

Copyright © 2003 Oracle Corporation. All Rights Reserved.