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
argsort will work fine. argpartition just performs better.
In case of you have 1million feature and if we want to identify first 500 important feature, using argpartition we dont need to sort the entire array. Algortithm will stop sorting, once it identified the last 500 (in case of negative indexing).
Hello there,
I could not understand this piece of code.
def indices_of_top_k(arr, k):
return np.sort(np.argpartition(np.array(arr), -k)[-k:])
Can't we just use argsort() instead?
Thanks for your help.
The text was updated successfully, but these errors were encountered: