bba1901f835525551dde9ec1537d041abc88d293,deslib/static/oracle.py,Oracle,predict,#Oracle#Any#Any#,77
Before Change
y = self.enc_.transform(y)
predicted_labels = -np.ones(y.size, dtype=int)
// TODO: Vectorize Oracle code.
for sample_index, x in enumerate(X):
for idx, clf in enumerate(self.pool_classifiers_):
// If one base classifier predicts the correct answer, consider
// as a correct prediction
x_feat = x[self.estimator_features_[idx]].reshape(1, -1)
predicted = clf.predict(x_feat)[0]
if predicted == y[sample_index]:
predicted = int(predicted)
predicted_labels[sample_index] = predicted
break
predicted_labels[sample_index] = predicted
return self.classes_.take(predicted_labels)
def predict_proba(self, X, y):
Estimates the posterior probabilities for each class for each sample
After Change
for idx, clf in enumerate(self.pool_classifiers_)]
preds = np.asarray(preds).T
hit_miss = np.asarray(preds) == y.reshape(-1, 1)
idx_sel_classifier = hit_miss.argmax(axis=1)
predicted_labels = preds[np.arange(preds.shape[0]), idx_sel_classifier]
return self.classes_.take(predicted_labels.astype(int))
def predict_proba(self, X, y):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances
Project Name: scikit-learn-contrib/DESlib
Commit Name: bba1901f835525551dde9ec1537d041abc88d293
Time: 2021-04-08
Author: rafaelmenelau@gmail.com
File Name: deslib/static/oracle.py
Class Name: Oracle
Method Name: predict
Project Name: AlexEMG/DeepLabCut
Commit Name: ef59c0f5b64e5a3e76790855795a6393c5858963
Time: 2020-05-27
Author: 30733203+jeylau@users.noreply.github.com
File Name: deeplabcut/generate_training_dataset/multiple_individuals_labeling_toolbox.py
Class Name: MainFrame
Method Name: browseDir
Project Name: DagnyT/hardnet
Commit Name: 04cd555be76efc7baced753c751c4257d41eb75d
Time: 2017-07-27
Author: ducha.aiki@gmail.com
File Name: EvalMetrics.py
Class Name:
Method Name: ErrorRateAt95Recall
Project Name: scikit-learn-contrib/DESlib
Commit Name: bba1901f835525551dde9ec1537d041abc88d293
Time: 2021-04-08
Author: rafaelmenelau@gmail.com
File Name: deslib/static/oracle.py
Class Name: Oracle
Method Name: predict