# KMeansIteration delegate

Namespace: [Grasshopper2.Geometry.Clustering](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.geometry.clustering.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public delegate KMeansIteration
```

Callback delegate for K-Means clustering calculations.

**Signature:**

```cs
ProcessInstruction KMeansIteration(ISampleSet set, KMeansCluster[] clusters, int iteration)
```

**Parameters:**

- `set` ([ISampleSet](https://developer.rhino3d.com/api/gh2/type/grasshopper2.geometry.clustering.isampleset.md)): Sampling set.
- `clusters` ([KMeansCluster[]](https://developer.rhino3d.com/api/gh2/type/grasshopper2.geometry.clustering.kmeanscluster.md)): Collection of intermediate clusters.
- `iteration` ([int](https://learn.microsoft.com/dotnet/api/system.int32)): Current iteration.
