@@ -965,11 +965,11 @@ def __init__(
965
965
966
966
def score (self , X , y = None ):
967
967
"""
968
- Returns the Haussdorf distances of all samples to previous selections
968
+ Returns the Hausdorff distances of all samples to previous selections
969
969
970
970
NOTE: This function does not compute the importance score each time it
971
- is called, in order to avoid unnecessary computations. The haussdorf
972
- distance is updated in :py:func:`self._update_haussdorf `
971
+ is called, in order to avoid unnecessary computations. The hausdorff
972
+ distance is updated in :py:func:`self._update_hausdorff `
973
973
974
974
Parameters
975
975
----------
@@ -978,9 +978,9 @@ def score(self, X, y=None):
978
978
979
979
Returns
980
980
-------
981
- haussdorf : Haussdorf distances
981
+ hausdorff : Hausdorff distances
982
982
"""
983
- return self .haussdorf_
983
+ return self .hausdorff_
984
984
985
985
def get_distance (self ):
986
986
"""
@@ -1002,40 +1002,40 @@ def get_distance(self):
1002
1002
Returns
1003
1003
-------
1004
1004
1005
- haussdorf : ndarray of shape (`n_to_select_from_`)
1005
+ hausdorff : ndarray of shape (`n_to_select_from_`)
1006
1006
the minimum distance from each point to the set of selected
1007
1007
points. once a point is selected, the distance is not updated;
1008
1008
the final list will reflect the distances when selected.
1009
1009
1010
1010
"""
1011
- return self .haussdorf_
1011
+ return self .hausdorff_
1012
1012
1013
1013
def get_select_distance (self ):
1014
1014
"""
1015
1015
1016
1016
Returns
1017
1017
-------
1018
1018
1019
- haussdorf_at_select : ndarray of shape (`n_to_select`)
1019
+ hausdorff_at_select : ndarray of shape (`n_to_select`)
1020
1020
at the time of selection, the minimum distance from each
1021
1021
selected point to the set of previously selected points.
1022
1022
1023
1023
"""
1024
1024
mask = self .get_support (indices = True , ordered = True )
1025
- return self .haussdorf_at_select_ [mask ]
1025
+ return self .hausdorff_at_select_ [mask ]
1026
1026
1027
1027
def _init_greedy_search (self , X , y , n_to_select ):
1028
1028
"""
1029
1029
Initializes the search. Prepares an array to store the selections,
1030
1030
makes the initial selection (unless provided), and
1031
- computes the starting haussdorf distances.
1031
+ computes the starting hausdorff distances.
1032
1032
"""
1033
1033
1034
1034
super ()._init_greedy_search (X , y , n_to_select )
1035
1035
1036
1036
self .norms_ = (X ** 2 ).sum (axis = abs (self ._axis - 1 ))
1037
- self .haussdorf_ = np .full (X .shape [self ._axis ], np .inf )
1038
- self .haussdorf_at_select_ = np .full (X .shape [self ._axis ], np .inf )
1037
+ self .hausdorff_ = np .full (X .shape [self ._axis ], np .inf )
1038
+ self .hausdorff_at_select_ = np .full (X .shape [self ._axis ], np .inf )
1039
1039
1040
1040
if self .initialize == "random" :
1041
1041
random_state = check_random_state (self .random_state )
@@ -1055,8 +1055,8 @@ def _init_greedy_search(self, X, y, n_to_select):
1055
1055
else :
1056
1056
raise ValueError ("Invalid value of the initialize parameter" )
1057
1057
1058
- def _update_haussdorf (self , X , y , last_selected ):
1059
- self .haussdorf_at_select_ [last_selected ] = self .haussdorf_ [last_selected ]
1058
+ def _update_hausdorff (self , X , y , last_selected ):
1059
+ self .hausdorff_at_select_ [last_selected ] = self .hausdorff_ [last_selected ]
1060
1060
1061
1061
# distances of all points to the new point
1062
1062
if self ._axis == 1 :
@@ -1068,15 +1068,15 @@ def _update_haussdorf(self, X, y, last_selected):
1068
1068
self .norms_ + self .norms_ [last_selected ] - 2 * X [last_selected ] @ X .T
1069
1069
)
1070
1070
1071
- # update in-place the Haussdorf distance list
1072
- np .minimum (self .haussdorf_ , new_dist , self .haussdorf_ )
1071
+ # update in-place the Hausdorff distance list
1072
+ np .minimum (self .hausdorff_ , new_dist , self .hausdorff_ )
1073
1073
1074
1074
def _update_post_selection (self , X , y , last_selected ):
1075
1075
"""
1076
1076
Saves the most recent selections, increments the counter,
1077
- and, recomputes haussdorf distances.
1077
+ and, recomputes hausdorff distances.
1078
1078
"""
1079
- self ._update_haussdorf (X , y , last_selected )
1079
+ self ._update_hausdorff (X , y , last_selected )
1080
1080
super ()._update_post_selection (X , y , last_selected )
1081
1081
1082
1082
@@ -1135,11 +1135,11 @@ def __init__(
1135
1135
1136
1136
def score (self , X , y = None ):
1137
1137
"""
1138
- Returns the Haussdorf distances of all samples to previous selections
1138
+ Returns the Hausdorff distances of all samples to previous selections
1139
1139
1140
1140
NOTE: This function does not compute the importance score each time it
1141
- is called, in order to avoid unnecessary computations. The haussdorf
1142
- distance is updated in :py:func:`self._update_haussdorf `
1141
+ is called, in order to avoid unnecessary computations. The hausdorff
1142
+ distance is updated in :py:func:`self._update_hausdorff `
1143
1143
1144
1144
Parameters
1145
1145
----------
@@ -1148,43 +1148,43 @@ def score(self, X, y=None):
1148
1148
1149
1149
Returns
1150
1150
-------
1151
- haussdorf : Haussdorf distances
1151
+ hausdorff : Hausdorff distances
1152
1152
"""
1153
- return self .haussdorf_
1153
+ return self .hausdorff_
1154
1154
1155
1155
def get_distance (self ):
1156
1156
"""
1157
1157
1158
1158
Returns
1159
1159
-------
1160
1160
1161
- haussdorf : ndarray of shape (`n_to_select_from_`)
1161
+ hausdorff : ndarray of shape (`n_to_select_from_`)
1162
1162
the minimum distance from each point to the set of selected
1163
1163
points. once a point is selected, the distance is not updated;
1164
1164
the final list will reflect the distances when selected.
1165
1165
1166
1166
"""
1167
- return self .haussdorf_
1167
+ return self .hausdorff_
1168
1168
1169
1169
def get_select_distance (self ):
1170
1170
"""
1171
1171
1172
1172
Returns
1173
1173
-------
1174
1174
1175
- haussdorf_at_select : ndarray of shape (`n_to_select`)
1175
+ hausdorff_at_select : ndarray of shape (`n_to_select`)
1176
1176
at the time of selection, the minimum distance from each
1177
1177
selected point to the set of previously selected points.
1178
1178
1179
1179
"""
1180
1180
mask = self .get_support (indices = True , ordered = True )
1181
- return self .haussdorf_at_select_ [mask ]
1181
+ return self .hausdorff_at_select_ [mask ]
1182
1182
1183
1183
def _init_greedy_search (self , X , y , n_to_select ):
1184
1184
"""
1185
1185
Initializes the search. Prepares an array to store the selections,
1186
1186
makes the initial selection (unless provided), and
1187
- computes the starting haussdorf distances.
1187
+ computes the starting hausdorff distances.
1188
1188
"""
1189
1189
1190
1190
super ()._init_greedy_search (X , y , n_to_select )
@@ -1205,12 +1205,12 @@ def _init_greedy_search(self, X, y, n_to_select):
1205
1205
raise ValueError ("Invalid value of the initialize parameter" )
1206
1206
1207
1207
self .selected_idx_ [0 ] = initialize
1208
- self .haussdorf_ = np .full (X .shape [self ._axis ], np .inf )
1209
- self .haussdorf_at_select_ = np .full (X .shape [self ._axis ], np .inf )
1208
+ self .hausdorff_ = np .full (X .shape [self ._axis ], np .inf )
1209
+ self .hausdorff_at_select_ = np .full (X .shape [self ._axis ], np .inf )
1210
1210
self ._update_post_selection (X , y , self .selected_idx_ [0 ])
1211
1211
1212
- def _update_haussdorf (self , X , y , last_selected ):
1213
- self .haussdorf_at_select_ [last_selected ] = self .haussdorf_ [last_selected ]
1212
+ def _update_hausdorff (self , X , y , last_selected ):
1213
+ self .hausdorff_at_select_ [last_selected ] = self .hausdorff_ [last_selected ]
1214
1214
1215
1215
# distances of all points to the new point
1216
1216
new_dist = (
@@ -1219,15 +1219,15 @@ def _update_haussdorf(self, X, y, last_selected):
1219
1219
- 2 * np .take (self .pcovr_distance_ , last_selected , axis = self ._axis )
1220
1220
)
1221
1221
1222
- # update in-place the Haussdorf distance list
1223
- np .minimum (self .haussdorf_ , new_dist , self .haussdorf_ )
1222
+ # update in-place the Hausdorff distance list
1223
+ np .minimum (self .hausdorff_ , new_dist , self .hausdorff_ )
1224
1224
1225
1225
def _update_post_selection (self , X , y , last_selected ):
1226
1226
"""
1227
1227
Saves the most recent selections, increments the counter,
1228
- and, recomputes haussdorf distances.
1228
+ and, recomputes hausdorff distances.
1229
1229
"""
1230
- self ._update_haussdorf (X , y , last_selected )
1230
+ self ._update_hausdorff (X , y , last_selected )
1231
1231
super ()._update_post_selection (X , y , last_selected )
1232
1232
1233
1233
def _more_tags (self ):
0 commit comments