abd0f7b5564e51a412bb7f85e040985d14eb0a4e,src/skmultiflow/meta/adaptive_random_forests.py,AdaptiveRandomForest,predict,#AdaptiveRandomForest#Any#,255
Before Change
predictions = []
for i in range(r):
votes = self.get_votes_for_instance(X[i])
if votes == {}:
// Ensemble is empty, all classes equal, default to zero
predictions.append(0)
else:
predictions.append(max(votes, key=votes.get))
return np.asarray(predictions)
def predict_proba(self, X):
Estimates the probability of each sample in X belonging to each of the class-labels.
After Change
A numpy.ndarray with all the predictions for the samples in X.
y_proba = self.predict_proba(X)
n_rows = y_proba.shape[0]
y_pred = np.zeros(n_rows, dtype=int)
for i in range(n_rows):
index = np.argmax(y_proba[i])
y_pred[i] = index
return y_pred
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 5
Instances
Project Name: scikit-multiflow/scikit-multiflow
Commit Name: abd0f7b5564e51a412bb7f85e040985d14eb0a4e
Time: 2019-10-06
Author: jacob.montiel@gmail.com
File Name: src/skmultiflow/meta/adaptive_random_forests.py
Class Name: AdaptiveRandomForest
Method Name: predict
Project Name: scikit-multiflow/scikit-multiflow
Commit Name: 6496c605ad12f3eaac3939804ee8bef0b82a2692
Time: 2019-02-27
Author: aquancva@gmail.com
File Name: src/skmultiflow/bayes/naive_bayes.py
Class Name: NaiveBayes
Method Name: predict
Project Name: scikit-multiflow/scikit-multiflow
Commit Name: 5bf139b5a4312e6bfbe6a196e68fb261ef674368
Time: 2019-02-25
Author: jacob.montiel@gmail.com
File Name: src/skmultiflow/bayes/naive_bayes.py
Class Name: NaiveBayes
Method Name: predict
Project Name: scikit-multiflow/scikit-multiflow
Commit Name: 7c8f60b92f031c91b74ec40d3ca944839c65d514
Time: 2018-05-31
Author: bader.d24@gmail.com
File Name: src/skmultiflow/classification/trees/hoeffding_tree.py
Class Name: HoeffdingTree
Method Name: predict