Extreme Optimization™: Complexity made simple.

Math and Statistics
Libraries for .NET

  • Home
  • Features
    • Math Library
    • Vector and Matrix Library
    • Statistics Library
    • Performance
    • Usability
  • Documentation
    • Introduction
    • Math Library User's Guide
    • Vector and Matrix Library User's Guide
    • Data Analysis Library User's Guide
    • Statistics Library User's Guide
    • Reference
  • Resources
    • Downloads
    • QuickStart Samples
    • Sample Applications
    • Frequently Asked Questions
    • Technical Support
  • Blog
  • Order
  • Company
    • About us
    • Testimonials
    • Customers
    • Press Releases
    • Careers
    • Partners
    • Contact us
Introduction
Deployment Guide
Nuget packages
Configuration
Using Parallelism
Expand Mathematics Library User's GuideMathematics Library User's Guide
Expand Vector and Matrix Library User's GuideVector and Matrix Library User's Guide
Expand Data Analysis Library User's GuideData Analysis Library User's Guide
Expand Statistics Library User's GuideStatistics Library User's Guide
Expand Data Access Library User's GuideData Access Library User's Guide
Expand ReferenceReference
  • Extreme Optimization
    • Features
    • Solutions
    • Documentation
    • QuickStart Samples
    • Sample Applications
    • Downloads
    • Technical Support
    • Download trial
    • How to buy
    • Blog
    • Company
    • Resources
  • Documentation
    • Introduction
    • Deployment Guide
    • Nuget packages
    • Configuration
    • Using Parallelism
    • Mathematics Library User's Guide
    • Vector and Matrix Library User's Guide
    • Data Analysis Library User's Guide
    • Statistics Library User's Guide
    • Data Access Library User's Guide
    • Reference
  • Reference
    • Extreme
    • Extreme.Collections
    • Extreme.Data
    • Extreme.Data.Json
    • Extreme.Data.Matlab
    • Extreme.Data.R
    • Extreme.Data.Stata
    • Extreme.Data.Text
    • Extreme.DataAnalysis
    • Extreme.DataAnalysis.Linq
    • Extreme.DataAnalysis.Models
    • Extreme.Mathematics
    • Extreme.Mathematics.Algorithms
    • Extreme.Mathematics.Calculus
    • Extreme.Mathematics.Calculus.OrdinaryDifferentialEquations
    • Extreme.Mathematics.Curves
    • Extreme.Mathematics.Curves.Nonlinear
    • Extreme.Mathematics.Distributed
    • Extreme.Mathematics.EquationSolvers
    • Extreme.Mathematics.Generic
    • Extreme.Mathematics.LinearAlgebra
    • Extreme.Mathematics.LinearAlgebra.Implementation
    • Extreme.Mathematics.LinearAlgebra.IterativeSolvers
    • Extreme.Mathematics.LinearAlgebra.IterativeSolvers.Preconditioners
    • Extreme.Mathematics.Optimization
    • Extreme.Mathematics.Optimization.LineSearches
    • Extreme.Mathematics.Random
    • Extreme.Mathematics.SignalProcessing
    • Extreme.Providers
    • Extreme.Providers.InteropServices
    • Extreme.Statistics
    • Extreme.Statistics.Distributions
    • Extreme.Statistics.Multivariate
    • Extreme.Statistics.Tests
    • Extreme.Statistics.TimeSeriesAnalysis
  • Extreme.Statistics.Multivariate
    • DendrogramNode Class
    • DistanceMeasures Class
    • Factor Class
    • FactorAnalysis Class
    • FactorCountMethod Enumeration
    • FactorExtractionMethod Enumeration
    • FactorMethod Enumeration
    • FactorRotationMethod Enumeration
    • FactorScoreMethod Enumeration
    • HierarchicalCluster Class
    • HierarchicalClusterAnalysis Class
    • HierarchicalClusterCollection Class
    • KMeansCluster Class
    • KMeansClusterAnalysis Class
    • KMeansInitializationMethod Enumeration
    • LinearDiscriminantAnalysis Class
    • LinearDiscriminantFunction Class
    • LinkageMethod Enumeration
    • PartialLeastSquaresMethod Enumeration
    • PartialLeastSquaresModel Class
    • PrincipalComponent Class
    • PrincipalComponentAnalysis Class
    • PrincipalComponentCollection Class
    • ScalingMethod Enumeration
    • SimilarityMatrix Class
  • KMeansClusterAnalysis Class
    • KMeansClusterAnalysis Constructors
    • Properties
    • Methods

KMeansClusterAnalysis Class

Extreme Optimization Numerical Libraries for .NET Professional
Represents a K-Means cluster analysis.
Inheritance Hierarchy

SystemObject
  Extreme.DataAnalysis.ModelsModel
    Extreme.DataAnalysis.ModelsClusteringModelDouble
      Extreme.Statistics.MultivariateKMeansClusterAnalysis

Namespace:  Extreme.Statistics.Multivariate
Assembly:  Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
Syntax

C#
VB
C++
F#
Copy
public class KMeansClusterAnalysis : ClusteringModel<double>
Public Class KMeansClusterAnalysis
	Inherits ClusteringModel(Of Double)
public ref class KMeansClusterAnalysis : public ClusteringModel<double>
type KMeansClusterAnalysis =  
    class
        inherit ClusteringModel<float>
    end

The KMeansClusterAnalysis type exposes the following members.

Constructors

  NameDescription
Public methodKMeansClusterAnalysis(IDataFrame, Int32)
Constructs a new KMeansClusterAnalysis.
Public methodKMeansClusterAnalysis(IEnumerableVectorDouble, Int32)
Constructs a new KMeansClusterAnalysis.
Public methodKMeansClusterAnalysis(MatrixDouble, Int32)
Constructs a new KMeansClusterAnalysis.
Public methodKMeansClusterAnalysis(IDataFrame, String, Int32)
Constructs a new KMeansClusterAnalysis.
Public methodKMeansClusterAnalysis(IDataFrame, String, Int32)
Constructs a new KMeansClusterAnalysis.
Top
Properties

  NameDescription
Public propertyBaseFeatureIndex
Gets an index containing the keys of the columns that are required inputs to the model.
(Inherited from Model.)
Public propertyCenters
Gets an array of cluster centers.
Public propertyClusters
Gets an array of clusters.
Public propertyComputed Obsolete.
Gets whether the model has been computed.
(Inherited from Model.)
Public propertyData
Gets an object that contains all the data used as input to the model.
(Inherited from Model.)
Public propertyFitted
Gets whether the model has been computed.
(Inherited from Model.)
Public propertyInitializationMethod
Gets or sets the method used to initialize the K-means algorithm.
Public propertyInputSchema
Gets the schema for the features used for fitting the model.
(Inherited from Model.)
Public propertyMaxDegreeOfParallelism
Gets or sets the maximum degree of parallelism enabled by this instance.
(Inherited from Model.)
Public propertyModelSchema
Gets the collection of variables used in the model.
(Inherited from Model.)
Public propertyNumberOfClusters
Gets or sets the number of clusters.
Public propertyNumberOfObservations
Gets the number of observations the model is based on.
(Inherited from Model.)
Protected propertyParallelOptions
Gets or sets an object that specifies how the calculation of the model should be parallelized.
(Inherited from Model.)
Public propertyPredictions
Returns the index of the cluster each observation belongs to as a CategoricalVectorT.
Public propertyRandomNumberGenerator
Gets or sets the random number generator that may be used during the initialization of the K-means algorithm.
Public propertyStandardize
Gets or sets whether the variables should be standardized before the clustering is computed.
Public propertyStatus
Gets the status of the model, which determines which information is available.
(Inherited from Model.)
Public propertySupportsWeights
Indicates whether the model supports case weights.
(Inherited from Model.)
Public propertyWeights
Gets or sets the actual weights.
(Inherited from Model.)
Top
Methods

  NameDescription
Public methodCompute Obsolete.
Computes the model.
(Inherited from Model.)
Public methodCompute(ParallelOptions) Obsolete.
Computes the model.
(Inherited from Model.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFit
Fits the model to the data.
(Inherited from Model.)
Public methodFit(ParallelOptions)
Fits the model to the data.
(Inherited from Model.)
Protected methodFitCore
Computes the clustering.
(Overrides ModelFitCore(ModelInput, ParallelOptions).)
Public methodGetClusterDistances
Gets a matrix that contains the distances between the clusters.
Public methodGetDavisBouldinIndex
Returns the Davis-Bouldin index for the cluster analysis.
Public methodGetDistancesToCenters
Returns a VectorT that contains the distance of each observation to its cluster center.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodResetComputation Obsolete.
Clears all fitted model parameters.
(Inherited from Model.)
Public methodResetFit
Clears all fitted model parameters.
(Inherited from Model.)
Public methodSetDataSource
Uses the specified data frame as the source for all input variables.
(Inherited from Model.)
Public methodSummarize
Returns a string containing a human-readable summary of the object using default options.
(Inherited from Model.)
Public methodSummarize(SummaryOptions)
Returns a string containing a human-readable summary of the object using the specified options.
(Overrides ModelSummarize(SummaryOptions).)
Public methodToString
Returns a string that represents the current object.
(Inherited from Model.)
Top
Remarks

Use the KMeansClusterAnalysis class to perform a K-means cluster analysis of numerical data.

K-means clustering partitions a set of observations into a predefined number of clusters. A number of initial cluster centers is chosen. The observations are assigned to the closest cluster. Each center is then recalculated as the mean of its members. This changes the distances between cluster centers and observations, so the observations are once again reassigned. This process is repeated until no more observations change cluster. Note that the final partition depends on the initial location of the centers. Different applications may return different results for the same dataset.

The number of clusters must be passed in a constructor. It can be accessed through the NumberOfClusters property. The Standardize property determines whether the variables are transformed to all have the same mean and standard deviation. The default is .

Once the clustering is computed by calling the Fit method, the Centers property gives access to a vector of cluster centers. The Predictions property returns a CategoricalVectorT that for each observation indicates the cluster it belongs to. It can be used to group the observations by their cluster assignment. GetDistancesToCenters returns a VectorT that contains the distance of each observation to the center of its cluster.

See Also

Reference

Extreme.Statistics.Multivariate Namespace

Copyright (c) 2004-2021 ExoAnalytics Inc.

Send comments on this topic to support@extremeoptimization.com

Copyright © 2004-2021, Extreme Optimization. All rights reserved.
Extreme Optimization, Complexity made simple, M#, and M Sharp are trademarks of ExoAnalytics Inc.
Microsoft, Visual C#, Visual Basic, Visual Studio, Visual Studio.NET, and the Optimized for Visual Studio logo
are registered trademarks of Microsoft Corporation.