Open nils-fl opened 4 years ago
Thank you for opening the issue. Tagging @dantegd and @JohnZed
We also would really like weights in KNN classifier, like in scikit learn:
weights{‘uniform’, ‘distance’} or callable, default=’uniform’
weight function used in prediction. Possible values:
‘uniform’ : uniform weights. All points in each neighborhood are weighted equally.
‘distance’ : weight points by the inverse of their distance. in this case, closer neighbors of a query point will have a greater influence than neighbors which are further away.
[callable] : a user-defined function which accepts an array of distances, and returns an array of the same shape containing the weights.
This is really helpful for a lot of data where the location of vector elements matters, etc.
This issue has been marked stale due to no recent activity in the past 30d. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be marked rotten if there is no activity in the next 60d.
This was implemented in https://github.com/rapidsai/cuml/pull/3572 . Given https://github.com/rapidsai/cuml/issues/3559 also covered sample weights for logistic regression, rather than close this issue I will update it to request KNN weights as per the most recent comment
It would be great to have a
sample_weight
option in thecuml.LogisticRegression
fit()
method like insklearn
. That way one could easily implement custom penalty methods.