Section: Visualization Toolkit Infovis Classes
To create an instance of class vtkKMeansDistanceFunctor, simply invoke its constructor as follows
obj = vtkKMeansDistanceFunctor
obj
is an instance of the vtkKMeansDistanceFunctor class.
string = obj.GetClassName ()
int = obj.IsA (string name)
vtkKMeansDistanceFunctor = obj.NewInstance ()
vtkKMeansDistanceFunctor = obj.SafeDownCast (vtkObject o)
vtkVariantArray = obj.GetEmptyTuple (vtkIdType dimension)
- Return an empty tuple. These values are used as cluster center coordinates
when no initial cluster centers are specified.
obj.PairwiseUpdate (vtkTable clusterCenters, vtkIdType row, vtkVariantArray data, vtkIdType dataCardinality, vtkIdType totalCardinality)
- This is called once per observation per run per iteration in order to assign the
observation to its nearest cluster center after the distance functor has been
evaluated for all the cluster centers.
The distance functor is responsible for incrementally updating the cluster centers
to account for the assignment.
obj.PerturbElement (vtkTable , vtkTable , vtkIdType , vtkIdType , vtkIdType , double )
- When a cluster center (1) has no observations that are closer to it than other cluster centers
or (2) has exactly the same coordinates as another cluster center, its coordinates should be
perturbed. This function should perform that perturbation.
Since perturbation relies on a distance metric, this function is the responsibility of the
distance functor.
vtkAbstractArray = obj.CreateCoordinateArray ()
- Return a vtkAbstractArray capable of holding cluster center coordinates.
This is used by vtkPKMeansStatistics to hold cluster center coordinates sent to (received from) other processes.
int = obj.GetDataType ()
- Return the data type used to store cluster center coordinates.