You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-2Lines changed: 26 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,18 +66,42 @@ var model = new HdbScan<double[]>(points, euclidean, options, predictionData: tr
66
66
var (label, probability) =model.PredictWithProbability(newPoint);
67
67
```
68
68
69
+
### Outlier detection
70
+
71
+
Each point receives a GLOSH outlier score between 0 and 1. Higher values indicate stronger outliers:
72
+
73
+
```csharp
74
+
for (vari=0; i<model.OutlierScores.Count; i++)
75
+
{
76
+
if (model.OutlierScores[i] >0.9)
77
+
Console.WriteLine($"Point {i} is a strong outlier (score {model.OutlierScores[i]:F3})");
78
+
}
79
+
```
80
+
69
81
### Options
70
82
71
83
| Property | Default | Description |
72
84
|---|---|---|
73
85
|`MinClusterSize`| 5 | Minimum number of points to form a cluster (>= 2) |
74
-
|`MinSamples`|0 (= MinClusterSize)| Number of neighbors for core point definition |
86
+
|`MinSamples`|`MinClusterSize`| Number of neighbors for core point definition, including the point itself (>= 2). See [sklearn compatibility](#sklearn-compatibility).|
75
87
|`ClusterSelectionMethod`|`ExcessOfMass`|`ExcessOfMass` for stable clusters, `Leaf` for fine-grained clusters |
76
88
|`AllowSingleCluster`|`false`| Whether to allow all points in a single cluster |
77
89
90
+
## sklearn compatibility
91
+
92
+
This implementation follows the **sklearn.cluster.HDBSCAN** convention where `MinSamples` includes the point itself. Results are validated against scikit-learn's output on multiple datasets.
93
+
94
+
If you are migrating from the **scikit-learn-contrib/hdbscan** library (which excludes self from the count), add 1 to your `min_samples` value:
Campello, R.J.G.B., Moulavi, D., Sander, J. (2013). "Density-Based Clustering Based on Hierarchical Density Estimates." PAKDD 2013. Lecture Notes in Computer Science, vol 7819. Springer.
104
+
Campello, R.J.G.B., Moulavi, D., Zimek, A., Sander, J. (2015). "Hierarchical Density Estimates for Data Clustering, Visualization, and Outlier Detection." ACM Trans. Knowl. Discov. Data 10, 1, Article 5 (July 2015). https://doi.org/10.1145/2733381
0 commit comments