cluster_utils
get_closest_clusters(X, centroids)
Function returning the closest centroid and distance for each given point.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X |
ndarray
|
Array of points |
required |
centroids |
ndarray
|
Array of centroids |
required |
Returns:
Type | Description |
---|---|
ndarray
|
Index of the closest cluster for each point |
ndarray
|
Distance to the closest cluster for each point |
Source code in streamndr/utils/cluster_utils.py
qnsc(pseudopoints, model, q_p=5)
Computes the q-neighborhood silhouette coefficient, as described in [1].
[1] Masud, Mohammad, et al. "Classification and novel class detection in concept-drifting data streams under time constraints." IEEE Transactions on knowledge and data engineering 23.6 (2010): 859-874.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pseudopoints |
ndarray
|
List of points |
required |
model |
list of MicroCluster
|
Microclusters representing a model |
required |
q_p |
int
|
Number of neighboring points to consider |
5
|
Returns:
Type | Description |
---|---|
ndarray
|
List of computed qnscs for each point |