Adding Data Points
The interface provides two ways to add points to your clustering dataset: manual entry and random generation.Manual Point Entry
TheInputPoint component allows you to specify exact coordinates:
Enter Coordinates
Use the X and Y input fields to specify the point coordinates. Both fields accept values between -1000 and 1000.
Random Point Generation
For quick testing or generating sample datasets, use the “Random Point” button:Random points are generated within a range of -100 to 100 on both axes, which provides good distribution for visualization.
Adding Centroids
Centroids are the cluster centers that the algorithm optimizes. Use the same interface pattern as adding points:Manual Centroid
Enter specific X and Y coordinates, then click “Add Centroid”
Random Centroid
Click “Random Centroid” to generate a centroid at random coordinates
The number of centroids determines the number of clusters (k) in the C-Means algorithm. Start with 2-3 centroids for clear visualization.
Viewing Your Data
The interface displays your points and centroids in two ways:Data Tables
Two separate tables show your current points and centroids with their exact coordinates:- X coordinate: Formatted to 4 decimal places
- Y coordinate: Formatted to 4 decimal places
Scatter Plot Visualization
The main visualization shows all points and centroids on a 2D scatter plot. Points are colored based on their cluster membership, while centroids are displayed with a distinct appearance and surrounding area indicator.Algorithm Controls
Two primary buttons control the clustering algorithm execution:Iterate Button
Click “Iterate” to perform one iteration of the C-Means algorithm:- Calculates distance matrix between all points and centroids
- Updates membership matrix based on distances
- Recalculates centroid positions
- Updates the cost function
Reset Button
The “Reset” button clears all calculated results while preserving your points and centroids:Interface Layout
The complete interface is organized into logical sections from top to bottom:Best Practices
Start Simple
Begin with 5-10 points and 2-3 centroids to understand the algorithm behavior
Use Random Generation
Random point generation is useful for quick testing and demonstrations
Watch the Cost Function
Monitor the cost function between iterations to observe convergence
Reset When Needed
Use Reset to start fresh with different initial centroid positions
Next Steps
Now that you understand the interface controls, learn how to interpret the results:Understanding Results
Learn how to read the distance matrix, membership matrix, and visualizations