9cdd21160f4b4352b05f7b7ce9f0f63506c585c9,benchmarks/bench_ml.py,MLBench,evaluate,#MLBench#Any#,192

Before Change



        try:
            self.model.fit(X_train, y_train)
            r = self.model.score(X_test, y_test)
        except BaseException as ex:
            r = 0.0 // on error: return assumed smallest value of objective function

        // while negative values could be informative, they could be very large also,
        // which could mess up the optimization procedure. Suggestions are welcome.
        return max(r, 0.0)

// this is necessary to generate table for README in the end
table_template = |Blackbox Function| Minimum | Best minimum |
------------------|------------|-----------|---------------------|

After Change


        try:
            model_instance.fit(X_train, y_train)
            if isinstance(model_instance, RegressorMixin): // r^2 metric
                y_predicted = model_instance.predict(X_test)
                score = r2_score(y_test, y_predicted)
            elif isinstance(model_instance, ClassifierMixin): // log loss
                y_predicted = model_instance.predict_proba(X_test)
                score = -log_loss(y_test, y_predicted) // in the context of this function, the higher score is better
            // avoid any kind of singularitites, eg probability being zero, and thus breaking the log_loss
            if math.isnan(score):
                score = min_obj_val
            score = max(score, min_obj_val) // this is necessary to avoid -inf or NaN
        except BaseException as ex:
            score = min_obj_val // on error: return assumed smallest value of objective function

        return score

// this is necessary to generate table for README in the end
table_template = |Blackbox Function| Minimum | Best minimum |
------------------|------------|-----------|---------------------|
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: scikit-optimize/scikit-optimize
Commit Name: 9cdd21160f4b4352b05f7b7ce9f0f63506c585c9
Time: 2017-04-17
Author: iaroslav-ai@users.noreply.github.com
File Name: benchmarks/bench_ml.py
Class Name: MLBench
Method Name: evaluate


Project Name: hmmlearn/hmmlearn
Commit Name: 934f26003a1b794a3a03ca824817fb1252dff270
Time: 2016-07-09
Author: yanenkoalexandr@gmail.com
File Name: hmmlearn/hmm.py
Class Name: GMMHMM
Method Name: _compute_log_likelihood


Project Name: facebookresearch/Horizon
Commit Name: e91a9941d0ee6d1198e4b05bbd39ce16b5c0d569
Time: 2018-02-27
Author: jjg@fb.com
File Name: ml/rl/training/discrete_action_trainer.py
Class Name: DiscreteActionTrainer
Method Name: get_q_values_all_actions