Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rand index over 1 #305

Open
seyseykun opened this issue Jul 27, 2023 · 1 comment
Open

Rand index over 1 #305

seyseykun opened this issue Jul 27, 2023 · 1 comment

Comments

@seyseykun
Copy link

seyseykun commented Jul 27, 2023

When performing ruptures.metric.randindex(bkps1, bkps2) with the two lists below, I obtain a value of 1.002088251282002, while the Rand index is supposed to be between 0 and 1.


bkps1 = [5338, 6766, 7154, 7173, 12244, 14707, 17672, 19448, 19460, 20717, 20732, 21327, 22265, 22591, 24695, 25372, 25936, 26073, 26316, 26326, 26901, 26969, 29887, 29901, 30364, 30433, 32905, 36333, 39037, 39054, 40446, 42076, 43532, 44262, 47820, 48304, 50871, 51038, 53561, 62202, 65810, 67386, 68141, 68235, 68626, 70421, 70435, 70937, 79021, 81554, 84436, 87278, 87521, 88402, 94163, 97984, 98228, 98715, 99506, 100627, 100643, 101298, 101326, 102490, 102665, 102766, 102839, 104923, 110593, 111396, 111426, 111665, 113245, 121000, 126768, 127192, 127714, 129647, 129657, 131620, 146273, 151044, 151706, 152275, 152346, 152364, 152488, 154343, 154901, 154969, 155749, 155761, 155947, 156692, 156703, 160531, 164525, 172328, 174394, 174422, 175323, 175412, 175761, 176158, 176185, 178372, 178989, 180630, 184193, 184525, 190080, 190542, 192530, 195278, 195431, 196043, 196417, 196965, 197430, 198130, 198151, 201606, 205640, 205671, 206618, 206668, 210409, 210420, 212581, 219433, 223396, 223508, 224304, 226933, 227370, 227585, 230335, 233442, 236232, 236529, 236545, 236756, 236769, 237162, 240479, 240509, 240716, 240974, 241945, 242283, 242627, 242645, 242992, 243520, 243897, 243909, 244634, 244650, 244829, 246488, 246910, 246922, 246980, 247010, 247216, 247231, 247462, 248486, 248707, 248991, 249774, 249799, 254087, 254104, 256966, 257630, 257790, 260062, 261281, 263240, 263885, 264176, 277763, 281755, 282414, 282757, 282768, 283029, 283044, 283789, 284876, 284886, 289298, 291351, 296145, 297357, 306611, 308622, 308682, 312052, 312070, 314924, 314934, 315949, 316148, 316425, 316588, 316599, 316644, 316723, 316856, 316868, 317817, 317837, 318546, 319582, 319593, 320127, 320506, 320516, 321711, 323253, 323284, 323913, 324503, 324521, 324791, 324868, 324934, 324958, 324973, 325046, 325137, 325150, 325296, 325324, 325350, 325362, 328201, 329050, 329084, 329109, 331578, 333404, 333418, 335705, 347448, 349187, 349216, 350706, 350782, 350812, 350877, 350907, 351196, 351250, 351619, 351635, 353745, 353961, 353991, 356918, 361955, 380666, 380676, 382511, 383359, 383790, 384469, 386566, 386650, 394860, 427765, 439048, 440208, 442167, 460670, 493575, 498012, 500009, 525460, 526480, 530932, 532612, 532627, 533685, 533798, 533819, 534252, 534319, 534616, 534702, 534868, 534915, 534925, 535162, 535263, 537715, 539793, 539812, 541988, 546949, 559385, 572718, 592290, 595682, 602247, 602321, 614898, 617345, 617510, 621881, 625195, 646182, 647476, 647632, 648348, 648431, 650988, 658100, 661055, 661068, 667033, 670513, 691005, 720273, 723910, 737485, 746877, 747928, 749142, 749152, 756815, 785477, 787512, 789720, 791593, 799643, 802446, 803018, 803513, 803529, 804230, 807149, 807455, 808333, 808435, 809044, 809109, 809334, 809670, 809936, 812389, 812399, 813002, 816383, 821071, 822625, 823914, 825758, 825989, 828851, 831106, 831885, 832146, 832196, 832435, 833595, 834455, 834808, 835005, 835946, 837382, 837758, 840227, 842375, 842462, 842627, 842787, 842823, 842903, 843050, 843085, 843107, 843140, 846445, 855530, 856760, 861607, 862783, 866791, 867265, 867332, 867481, 867731, 867747, 867918, 868106, 868120, 869250, 869285, 869981, 870014, 870095, 870356, 870822, 871329, 871665, 872127, 872185, 872256, 872280, 872679, 872715, 872805, 874551, 874623, 874707, 874759, 875387, 875441, 878235, 878981, 888296, 888435, 888935, 888954, 889104, 889120, 892206, 892687, 899524, 908064, 908975, 908993, 909113, 909728, 909799, 909932, 910206, 910516, 911186, 911301, 913145, 915612, 921340, 923783, 927497, 928961, 933141, 933890, 935810, 935820, 938235, 938591, 938700, 938785, 938814, 939304, 941886, 941926, 942355, 943055, 943257, 943744, 944757, 945713, 946890, 947624, 948040, 948656, 949218, 950250, 951060, 951524, 951615, 951825, 952243, 953519, 954197, 954227, 954245, 955535, 957883, 958979, 958998, 959084, 959364, 960427, 960520, 964835, 975733, 978095, 981279, 981454, 982396, 984486, 984539, 984857, 985679, 985699, 985977, 985988, 986122, 987150, 989009, 989388, 989665, 990293, 990698, 990736, 991224, 991513, 991668, 991772, 991796, 992179, 992192, 992723, 992814, 993679, 993731, 993957, 994145, 995303, 995319, 995796, 995949, 997255, 997318, 998299, 999520, 1000174, 1008183, 1008214, 1010030, 1010556, 1010813, 1011066, 1011513, 1012490, 1015402, 1016157, 1016761, 1017215, 1017399, 1017527, 1018674, 1019057, 1019509, 1019526, 1020055, 1020447, 1020478, 1023739, 1031564, 1031766, 1032197, 1032637, 1033715, 1033943, 1034111, 1034345, 1034375, 1035038, 1035638, 1036425, 1037092, 1037121, 1037998, 1038054, 1039657, 1039880, 1040418, 1040726, 1041203, 1041230, 1041614, 1041631, 1042014, 1042348, 1043145, 1043636, 1043659, 1044314, 1044327, 1044615, 1045966, 1046216, 1046237, 1046922, 1047309, 1047398, 1047461, 1048269, 1048438, 1050564, 1052960, 1053640, 1055328, 1055724, 1056137, 1056154, 1059362, 1059552, 1059577, 1059771, 1061426, 1062710, 1063849, 1063916, 1065455, 1066970, 1067125, 1067218, 1067303, 1068027, 1069739, 1070393, 1070442, 1070587, 1071645, 1072258, 1072270, 1072393, 1072498, 1072777, 1073345, 1073358, 1073621, 1073879, 1076775, 1077234, 1077259, 1077461, 1077494, 1081427, 1081921, 1083157, 1083176, 1084681, 1085865, 1086837, 1088332, 1088348, 1090436, 1091042, 1091377, 1098861, 1100008, 1100051, 1101387, 1101406, 1101731, 1101810, 1101856, 1101883, 1102396, 1102420, 1103634, 1103662, 1105092, 1108992, 1114505, 1118066, 1118079, 1118770, 1127423, 1131203, 1140349, 1142714, 1142725, 1143407, 1150773, 1151675, 1152082, 1152407, 1152462, 1153185, 1153195, 1154100, 1154155, 1154280, 1154363, 1154375, 1154856, 1154910, 1155173, 1155337, 1156353, 1157361, 1157515, 1157969, 1158121, 1158295, 1158350, 1158412, 1158446, 1158501, 1158527, 1158870, 1159555, 1159586, 1160299, 1160363, 1160462, 1160475, 1160642, 1160783, 1160884, 1160956, 1161217, 1161231, 1161631, 1161686, 1161799, 1161822, 1162103, 1162146, 1163916, 1163962, 1164449, 1164488, 1166399, 1168108, 1169205, 1169561, 1173838, 1184580, 1194988, 1205328, 1209703, 1212616, 1217485, 1225055, 1225071, 1236091, 1244532, 1250390, 1258592, 1264860, 1265052, 1267668, 1267678, 1271053, 1275278, 1278754, 1283295]

bkps2 = [6238, 7179, 17679, 25307, 26969, 32905, 38071, 43532, 44262, 50868, 51038, 53561, 62202, 65810, 67386, 70943, 81556, 84436, 88369, 94163, 98715, 101282, 102841, 104923, 110593, 111396, 111665, 126784, 128464, 131620, 147038, 152283, 152410, 154901, 154969, 157020, 160531, 164525, 172870, 175201, 178989, 192932, 196041, 196400, 197430, 201606, 211153, 219433, 227845, 230335, 236506, 244830, 246880, 249037, 256966, 263240, 264176, 277763, 281755, 282241, 284894, 289297, 296145, 311961, 316587, 316723, 321711, 324500, 325368, 328201, 329050, 335705, 348044, 351196, 351250, 351696, 353745, 353991, 361955, 382165, 386728, 394860, 427765, 439200, 442167, 460670, 493575, 526480, 532555, 535271, 537715, 546710, 559385, 592290, 614829, 621881, 625195, 646193, 650982, 658100, 661269, 667047, 691005, 723910, 737485, 747928, 756815, 785476, 789720, 791593, 800253, 804230, 807456, 808436, 809334, 809670, 809936, 822625, 825688, 825989, 829320, 831636, 833598, 834455, 834869, 837925, 842375, 842903, 843050, 843140, 846445, 855530, 866791, 872112, 872281, 872667, 872805, 874551, 874824, 879017, 888435, 892724, 899524, 908064, 911301, 915607, 921340, 932977, 938235, 939304, 942337, 949280, 951322, 951895, 953519, 954245, 958934, 959364, 961181, 978093, 984858, 986122, 987150, 990278, 995794, 1010552, 1012490, 1016761, 1017527, 1020055, 1023739, 1033718, 1034415, 1039657, 1039878, 1042014, 1042348, 1043145, 1044619, 1046922, 1047309, 1048269, 1048438, 1050564, 1052960, 1053640, 1055328, 1055724, 1061283, 1066904, 1068027, 1069667, 1072393, 1072770, 1076774, 1077504, 1081921, 1084681, 1085865, 1090396, 1100008, 1100051, 1101728, 1105031, 1108992, 1118770, 1127423, 1131203, 1140349, 1142714, 1142725, 1151675, 1154096, 1154915, 1157949, 1158535, 1158870, 1160956, 1162651, 1173827, 1184580, 1206073, 1217485, 1236109, 1250390, 1260591, 1270501, 1283295]
@Lucas-Prates
Copy link
Contributor

Greetings!

I failed to reproduce your result. Installing the latest version (1.1.8) of ruptures, the output of the randindex method for the provided lists was $0.9968722559866201$ . I also tested it on sklearn using sklearn.metrics.randindex method. Using the same input (it has to be adapted since they handle clustering instead of change-points directly), and the output was again $0.9968722559866201$ , matching exactly ruptures output.

Could you check your output again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants