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
{{ message }}
This repository was archived by the owner on Mar 6, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 6, 2021. It is now read-only.
probabilities[row,:] = raw_predictions[row,:] / total
return probabilities
(The + signs are from my GIT diffs, please ignore).
I'm not overly familiar with ELMs but if you think the above is correct, feel free to add it up. Alternatively I would be happy to contribute code to the project.
So I was able to get around this for classification problems by hacking the elm class. If you notice there is a method called decision_function for the class. If you use that natively you'll get some an array of numbers stretching from -1 to 1. So it's not usable on its own, but you can modify that and extend the class to get it to work. Here's how sklearn does it with the MLPClassifier. And here's how predict is actually implemented. And here's how you would do it with the elm
class ELMWrapper(ELMClassifier):
def predict_proba(self, x):
return self.decision_function(x)
from sklearn.preprocessing import LabelBinarizer
elm = ELMWrapper(binarizer=LabelBinarizer())
It's important to set the LabelBinarizer class up this way. Otherwise your prediction probabilities will be from -1 to 1. I imagine that if you wanted to keep the native binarizer you could scale the binarizer predictions in the predict_proba method, but I'm lazy on code and this seems to work just fine for me.
Activity
hahnicity commentedon May 6, 2017
So I was able to get around this for classification problems by hacking the elm class. If you notice there is a method called
decision_functionfor the class. If you use that natively you'll get some an array of numbers stretching from -1 to 1. So it's not usable on its own, but you can modify that and extend the class to get it to work. Here's how sklearn does it with the MLPClassifier. And here's how predict is actually implemented. And here's how you would do it with the elmIt's important to set the
LabelBinarizerclass up this way. Otherwise your prediction probabilities will be from -1 to 1. I imagine that if you wanted to keep the native binarizer you could scale the binarizer predictions in thepredict_probamethod, but I'm lazy on code and this seems to work just fine for me.renatoosousa commentedon Jun 19, 2017
it works? please, share with us :)
gsk1692 commentedon Dec 16, 2017
Hello,
Has this worked? Which is the correct one? Those who have tried, please let us know...
Is there any other predict_proba method for ELM?