• Articles
  • Api Documentation
Show / Hide Table of Contents
  • Paramdigma.Core
    • Convert
    • Intersect3D
    • Intersect3D.LineLineIntersectionResult
    • Intersect3D.LineLineIntersectionStatus
    • Intersect3D.LinePlaneIntersectionStatus
    • Intersect3D.RayFacePerimeterIntersectionStatus
    • Settings
  • Paramdigma.Core.Collections
    • Interval
    • Matrix<T>
  • Paramdigma.Core.Curves
    • Geodesics
    • LevelSets
  • Paramdigma.Core.Exceptions
    • UnsetGeometryException
  • Paramdigma.Core.Extensions
    • Lists
  • Paramdigma.Core.Geometry
    • BaseCurve
    • BasePoint
    • Box
    • Circle
    • Cylinder
    • Delaunay
    • InvalidCurveException
    • Line
    • Line2d
    • Mesh
    • MeshCorner
    • MeshEdge
    • MeshFace
    • MeshGeometry
    • MeshHalfEdge
    • MeshPoint
    • MeshTopology
    • MeshVertex
    • NurbsCurve
    • NurbsSurface
    • Plane
    • Point2d
    • Point3d
    • Point4d
    • Polyline
    • Polyline2d
    • Ray
    • Ray2d
    • Rectangle2d
    • Sphere
    • Torus
    • Vector2d
    • Vector3d
    • VectorNd
  • Paramdigma.Core.Geometry.Interfaces
    • ICurve
    • ISurface
    • IVector
  • Paramdigma.Core.IO
    • CsvReader
    • CsvWritter
    • OBJMeshData
    • ObjReader
    • ObjWritter
    • OffMeshData
    • OffReader
    • OffResult
    • OffWriter
  • Paramdigma.Core.LinearAlgebra
    • Complex
    • LeastSquaresLinearFit
    • Triplet
    • TripletData
  • Paramdigma.Core.Optimization
    • GradientDescent
    • GradientDescent.FitnessFunction
    • GradientDescentOptions
    • GradientDescentResult
    • KMeansCluster
    • KMeansClustering
    • KMeansClustering.IterationCompletedEventArgs
  • Paramdigma.Core.Spatial
    • DelaunayEdge
    • DelaunayPoint
    • DelaunayTriangle
    • Octree
    • PointCloud
    • PointCloudMember
    • QuadTree

Class KMeansClustering

Generic K-Means Clustering Algorithm for N dimensional vectors.

Inheritance
System.Object
KMeansClustering
Namespace: Paramdigma.Core.Optimization
Assembly: Paramdigma.Core.dll
Syntax
public class KMeansClustering : object

Constructors

| Improve this Doc View Source

KMeansClustering(Int32, Int32, List<VectorNd>)

Initializes a new instance of the KMeansClustering class.

Declaration
public KMeansClustering(int maxIterations, int clusterCount, List<VectorNd> data)
Parameters
Type Name Description
System.Int32 maxIterations

Maximum iterations allowed.

System.Int32 clusterCount

Desired amount of clusters.

List<VectorNd> data

List of N dimensional vectors to cluster.

Properties

| Improve this Doc View Source

Clusters

Gets or sets the list of clusters.

Declaration
public List<KMeansCluster> Clusters { get; set; }
Property Value
Type Description
List<KMeansCluster>

Methods

| Improve this Doc View Source

FindIndexOfSimilar(List<VectorNd>, VectorNd)

Find the index of the most similar vector to a given one.

Declaration
public int FindIndexOfSimilar(List<VectorNd> pool, VectorNd vector)
Parameters
Type Name Description
List<VectorNd> pool

List of vectors to compare with.

VectorNd vector

Reference vector.

Returns
Type Description
System.Int32

Index of the most similar vector in the pool.

| Improve this Doc View Source

OnIterationCompleted(KMeansClustering.IterationCompletedEventArgs)

Method to call when an iteration is completed.

Declaration
protected virtual void OnIterationCompleted(KMeansClustering.IterationCompletedEventArgs iterArgs)
Parameters
Type Name Description
KMeansClustering.IterationCompletedEventArgs iterArgs

Data for the current iteration.

| Improve this Doc View Source

Run()

Run the algorithm until it reaches the maximum amount of iterations.

Declaration
public void Run()
| Improve this Doc View Source

Run(Int32, Boolean)

Run the k-means clustering algorithm for a specified amount of iterations.

Declaration
public void Run(int iterations, bool allowEmptyClusters)
Parameters
Type Name Description
System.Int32 iterations

Iterations to run.

System.Boolean allowEmptyClusters

True to allow the optimization to leave clusters empty.

Events

| Improve this Doc View Source

IterationCompleted

Raised when an iteration is completed.

Declaration
public event EventHandler<KMeansClustering.IterationCompletedEventArgs> IterationCompleted
Event Type
Type Description
EventHandler<KMeansClustering.IterationCompletedEventArgs>
  • Improve this Doc
  • View Source
Back to top Generated by DocFX