|
2 | 2 | Radius Clustering |
3 | 3 |
|
4 | 4 | This module provides functionality for Minimum Dominating Set (MDS) based clustering. |
5 | | -It includes methods for solving MDS problems and applying the solutions to clustering tasks. |
| 5 | +It includes methods for solving MDS problems and applying the solutions to |
| 6 | +clustering tasks. |
6 | 7 |
|
7 | 8 | This module serves as the main interface for the Radius clustering library. |
8 | 9 | """ |
@@ -71,14 +72,17 @@ def fit(self, X, y=None): |
71 | 72 | >>> from radius_clustering import RadiusClustering |
72 | 73 | >>> from sklearn import datasets |
73 | 74 | >>> # Load the Iris dataset |
74 | | - >>> iris = datasets.fetch_openml(name='iris', version=1, parser='auto') |
75 | | - >>> X = iris['data'] # Use dictionary-style access instead of attribute access |
76 | | - >>> rad = RadiusClustering(manner="exact", threshold=1.43).fit(X) #Threshold set to 1.43 because it is the optimal |
77 | | - ... #threshold for the Iris dataset |
| 75 | + >>> iris = datasets.fetch_openml(name="iris", version=1, parser="auto") |
| 76 | + >>> X = iris["data"] # Use dictionary-style access instead of attribute access |
| 77 | + >>> rad = RadiusClustering(manner="exact", threshold=1.43).fit( |
| 78 | + ... X |
| 79 | + ... ) # Threshold set to 1.43 because it is the optimal |
| 80 | + ... # threshold for the Iris dataset |
78 | 81 | >>> rad.centers_ |
79 | 82 | [96, 49, 102] |
80 | 83 |
|
81 | | - For examples on common datasets and differences with kmeans, see :ref:`sphx_glr_auto_examples_plot_iris_example.py` |
| 84 | + For examples on common datasets and differences with kmeans, |
| 85 | + see :ref:`sphx_glr_auto_examples_plot_iris_example.py` |
82 | 86 | """ |
83 | 87 | self.X = check_array(X) |
84 | 88 |
|
@@ -164,7 +168,8 @@ def _compute_effective_radius(self): |
164 | 168 | """ |
165 | 169 | Compute the effective radius of the clustering. |
166 | 170 |
|
167 | | - The effective radius is the maximum radius among all clusters. That means EffRad = max(R(C_i)) for all i. |
| 171 | + The effective radius is the maximum radius among all clusters. |
| 172 | + That means EffRad = max(R(C_i)) for all i. |
168 | 173 | """ |
169 | 174 | self.effective_radius = np.min(self.dist_mat[:, self.centers_], axis=1).max() |
170 | 175 |
|
|
0 commit comments