TheAlgorithms / C-Plus-Plus

Collection of various algorithms in mathematics, machine learning, computer science and physics implemented in C++ for educational purposes.
https://thealgorithms.github.io/C-Plus-Plus
MIT License
30.03k stars 7.1k forks source link

Create silhouette_score.cpp #2608

Closed Swish78 closed 10 months ago

Swish78 commented 11 months ago

Description of Change

Added an implementation of the Silhouette Score calculation in C++ following TheAlgorithms project guidelines. The Silhouette Score is a metric used to assess the quality of clustering results. The code includes functions to calculate the Silhouette Score for a dataset based on pairwise distances between data points and their cluster labels. Three test cases have been added to validate the correctness of the implementation.

Checklist

Notes: This PR adds the Silhouette Score calculation code following project guidelines, including tests and documentation.