scikit learn Label propagation

Label propagation provided by scikit-learn only allows two options for constructing the affinity matrix. 1) RBF and 2) kNN.

The former results in a completed graph where weight on each edges is the rbf function of the distance between samples whereas the latter results in a sparse graph where each sample is only connected to its k nearest neighbors and weights are all ones.

I want to combine these two options: only connect each sample to its k nearest neighbors and use rbf to compute weights on the edges. I couldn't find a way to customize this using this label propagation class provided by sklearn. Does anyone know of an alternative to this label propagation provided by sklearn?

Edit: I just found the code from Github (https://github.com/yamaguchiyuto/label_propagation/blob/master/label_propagation.py) that might provide what I need. I'm trying it, but if anyone knows of something related to this, I would appreciate that too. :)

Topic semi-supervised-learning scikit-learn

Category Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.