Rand index (randindex
)#
Computes the Rand index (between 0 and 1) between two segmentations.
The Rand index (RI) measures the similarity between two segmentations and is equal to the proportion of aggreement between two partitions.
RI is between 0 (total disagreement) and 1 (total agreement). This function uses the efficient implementation of [1].
[1] Prates, L. (2021). A more efficient algorithm to compute the Rand Index for change-point problems. ArXiv:2112.03738.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bkps1 |
list
|
sorted list of the last index of each regime. |
required |
bkps2 |
list
|
sorted list of the last index of each regime. |
required |
Returns:
Name | Type | Description |
---|---|---|
float |
Rand index |
Source code in ruptures/metrics/randindex.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|