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
importnumpyasnpfromskmatter.feature_selectionimportFPSnp.random.seed(0)
n_samples=10n_features=15X=np.random.rand(n_samples , n_features )
X[:, 3] =np.random.rand(10) *1e-13X[:, 4] =np.random.rand(10) *1e-13selector_problem=FPS(n_to_select=len(X.T)).fit(X)
print(selector_problem.selected_idx_)
print(selector_problem.get_select_distance())
print()
# this selector does not have the problem because we stop before the score thresholdselector=FPS(n_to_select=len(X.T), score_threshold=1e-9).fit(X)
print(selector.selected_idx_)
print(selector.get_select_distance())
You can see in the first selector that 8 is reselected and sets the wrong score. This is because we do not filter for not selected points in the GreedySelector base class when choosing the next point.
So when the scores are all (numerical) zero, then points that have been already selected can be reselected.
Solution
One could add selected_idx_ to the GreedySelector base class and change
the argmax in the function above that it only considers the not selected indices.
The text was updated successfully, but these errors were encountered:
Detected by @PicoCentauri
Problem
Out:
You can see in the first selector that 8 is reselected and sets the wrong score. This is because we do not filter for not selected points in the GreedySelector base class when choosing the next point.
scikit-matter/src/skmatter/_selection.py
Line 371 in d56ccbd
So when the scores are all (numerical) zero, then points that have been already selected can be reselected.
Solution
One could add
selected_idx_
to the GreedySelector base class and changethe argmax in the function above that it only considers the not selected indices.
The text was updated successfully, but these errors were encountered: