nok / sklearn-porter

Transpile trained scikit-learn estimators to C, Java, JavaScript and others.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there any plans to support "distance" weights and "predict_proba" method for KNearestNeighbour ?

KMKnation opened this issue · comments

Currently i am generating my java file with training "uniform" weights but i want to generate java code with the "distance" weights.

When i am trying to generate it with the "distance" weight it generates NotImplementedError.

If i have to implement it on my own, How can i implement ?.

Any idea can help me. :)

In general the predict_proba method is planned for all estimators and languages.


After a quick check I ended in extmath.py#L410-L480 (from sklearn/neighbors/classification.py#L158 and sklearn/neighbors/classification.py#L165) which is used to compute the weighted result in a KNN. These are the places I would use to reimplement the logic in the target programming language.

is there any updates?