0e17f47e9a4920e276bb61b60d6de16264bc6bcf,pythonds/static/single_best.py,SingleBest,predict_proba,#SingleBest#Any#,37

Before Change


    def predict_proba(self, X):
        if "predict_proba" in dir(self.best_clf):
            return self.best_clf.predict_proba(X)
        elif "decision_function" in dir(self.best_clf):
            return softmax(self.best_clf.decision_function(X))
        else:
            raise ValueError("Base classifiers must be able to estimate probabilities.")

After Change


            raise ValueError("Base classifier must support the predict_proba function.")

        predicted_proba = self.best_clf.predict_proba(X)
        return predicted_proba

    def _check_is_fitted(self):
        Verify if the estimator algorithm was fitted.
           Raises an error if it is not fitted.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: scikit-learn-contrib/DESlib
Commit Name: 0e17f47e9a4920e276bb61b60d6de16264bc6bcf
Time: 2017-12-29
Author: rafaelmenelau@gmail.com
File Name: pythonds/static/single_best.py
Class Name: SingleBest
Method Name: predict_proba


Project Name: WZBSocialScienceCenter/tmtoolkit
Commit Name: 8de95b27c53cc83b249a18c4b36bc4d82524cace
Time: 2019-02-20
Author: markus.konrad@wzb.eu
File Name: tmtoolkit/preprocess/utils.py
Class Name:
Method Name: remove_special_chars_in_tokens


Project Name: matthewwithanm/django-imagekit
Commit Name: b8e57dccd6731381e4cad2cb3e0d70ea2b886c5e
Time: 2011-10-06
Author: lettertwo@gmail.com
File Name: imagekit/utils.py
Class Name:
Method Name: get_spec_files