This repository was archived by the owner on Mar 6, 2021. It is now read-only.

Description
Hi
I recently needed to predict the class probabilities instead of the class labels.
So I wrote a predict_proba() method, sticking to the convention used in other scikit classifiers.
I added the following which simply take considers the exponential ratios of the decision functions,
to class GenELMClassifier to the module elm.py .
- def predict_proba(self, X):
-
"""Predict probability values using the model
-
Considers exponent of decision_function values
-
-
X : {array-like, sparse matrix} of shape [n_samples, n_features]
-
-
C : numpy array of shape [n_samples, n_outputs]
-
-
-
raw_predictions = np.exp(self.decision_function(X))
-
probabilities = np.zeros(raw_predictions.shape)
-
rows, cols = raw_predictions.shape
-
for row in range(0, rows):
-
total = sum(raw_predictions[row,:])
-
probabilities[row,:] = raw_predictions[row,:] / total
-
(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.