Knn Classifier With Squared Iverse Weights In Python( Weight Is A Callable Function)
I am trying to apply kNN classifer with squared inverse weights using sklearn.neighbors.KNeighborsClassifier package. According to the documentation we can define a function for th
Solution 1:
isd
is your callable but isd()
is a call and evaluates to the return value of the call.
So, use weights=isd
without the ()
.
Post a Comment for "Knn Classifier With Squared Iverse Weights In Python( Weight Is A Callable Function)"