126#ifndef vtkKMeansStatistics_h
127#define vtkKMeansStatistics_h
129#include "vtkFiltersStatisticsModule.h"
157 vtkSetMacro(DefaultNumberOfClusters,
int);
158 vtkGetMacro(DefaultNumberOfClusters,
int);
165 vtkSetStringMacro(KValuesArrayName);
166 vtkGetStringMacro(KValuesArrayName);
174 vtkSetMacro(MaxNumIterations,
int);
175 vtkGetMacro(MaxNumIterations,
int);
183 vtkSetMacro(Tolerance,
double);
184 vtkGetMacro(Tolerance,
double);
maintain an unordered list of data objects
general representation of visualization data
dynamic, self-adjusting array of double
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
dynamic, self-adjusting array of int
measure distance from k-means cluster centers
A class for KMeans clustering.
int MaxNumIterations
This is the maximum number of iterations allowed if the new cluster centers have not yet converged.
void SelectAssessFunctor(vtkTable *inData, vtkDataObject *inMeta, vtkStringArray *rowNames, AssessFunctor *&dfunc) override
Provide the appropriate assessment functor.
static vtkKMeansStatistics * New()
void Aggregate(vtkDataObjectCollection *, vtkMultiBlockDataSet *) override
Given a collection of models, calculate aggregate model NB: not implemented.
virtual void UpdateClusterCenters(vtkTable *newClusterElements, vtkTable *curClusterElements, vtkIdTypeArray *numMembershipChanges, vtkIdTypeArray *numDataElementsInCluster, vtkDoubleArray *error, vtkIdTypeArray *startRunID, vtkIdTypeArray *endRunID, vtkIntArray *computeRun)
Subroutine to update new cluster centers from the old centers.
char * KValuesArrayName
This is the name of the column that specifies the number of clusters in each run.
void Learn(vtkTable *, vtkTable *, vtkMultiBlockDataSet *) override
Execute the calculations required by the Learn option.
vtkKMeansDistanceFunctor * DistanceFunctor
This is the Distance functor.
bool SetParameter(const char *parameter, int index, vtkVariant value) override
A convenience method for setting properties by name.
virtual vtkIdType GetTotalNumberOfObservations(vtkIdType numObservations)
Subroutine to get the total number of observations.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int DefaultNumberOfClusters
This is the default number of clusters used when the user does not provide initial cluster centers.
void Derive(vtkMultiBlockDataSet *) override
Execute the calculations required by the Derive option.
void Assess(vtkTable *, vtkMultiBlockDataSet *, vtkTable *) override
Execute the calculations required by the Assess option.
int InitializeDataAndClusterCenters(vtkTable *inParameters, vtkTable *inData, vtkTable *dataElements, vtkIdTypeArray *numberOfClusters, vtkTable *curClusterElements, vtkTable *newClusterElements, vtkIdTypeArray *startRunID, vtkIdTypeArray *endRunID)
Subroutine to initialize the cluster centers using those provided by the user in input port LEARN_PAR...
virtual void CreateInitialClusterCenters(vtkIdType numToAllocate, vtkIdTypeArray *numberOfClusters, vtkTable *inData, vtkTable *curClusterElements, vtkTable *newClusterElements)
Subroutine to initialize cluster centerss if not provided by the user.
~vtkKMeansStatistics() override
double Tolerance
This is the percentage of data elements that swap cluster IDs.
void Test(vtkTable *, vtkMultiBlockDataSet *, vtkTable *) override
Execute the calculations required by the Test option.
virtual void SetDistanceFunctor(vtkKMeansDistanceFunctor *)
Set the DistanceFunctor.
Composite dataset that organizes datasets into blocks.
A base class for a functor that assesses data.
Base class for statistics algorithms.
a vtkAbstractArray subclass for strings
A table, which contains similar-typed columns of data.
A atomic type representing the union of many types.