28793deaf98b37ef5d9425c1ec975a11b397e465,dask_ml/model_selection/_incremental.py,BaseIncrementalSearchCV,_get_best,#BaseIncrementalSearchCV#Any#Any#,505

Before Change


        best_index = -1
        // history_results is sorted by (model_id, partial_fit_calls)
        // best is the model_id with the highest partial fit calls
        for k, v in itertools.groupby(history_results, key=key):
            v = list(v)
            best_index += len(v)
            if k == best_model_id:
                break

        return results.models[best_model_id], best_index

    def _process_results(self, results):
        Called with the output of `fit` immediately after it finishes.

After Change


        model_ids = list(scores.keys())
        scores = [scores[k] for k in model_ids]
        model_idx = np.argmax(scores)
        best_model_id = model_ids[model_idx]

        best_est = results.models[best_model_id]

        idx = cv_results["model_id"] == best_model_id
        assert idx.sum() == 1
        best_idx = np.argmax(idx)
        return best_idx, best_est

    def _process_results(self, results):
        Called with the output of `fit` immediately after it finishes.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: dask/dask-ml
Commit Name: 28793deaf98b37ef5d9425c1ec975a11b397e465
Time: 2018-10-13
Author: github@stsievert.com
File Name: dask_ml/model_selection/_incremental.py
Class Name: BaseIncrementalSearchCV
Method Name: _get_best


Project Name: WZBSocialScienceCenter/tmtoolkit
Commit Name: 9def69a805132ff7549744b5b30a2fa7531fa405
Time: 2019-06-12
Author: markus.konrad@wzb.eu
File Name: tmtoolkit/preprocess/_tmpreproc.py
Class Name: TMPreproc
Method Name: load_tokens_dataframe


Project Name: soft-matter/trackpy
Commit Name: c6607119c25d0178245243ef3fdd3d176dd0d8f2
Time: 2020-01-22
Author: anntzer.lee@gmail.com
File Name: trackpy/linking/utils.py
Class Name:
Method Name: coords_from_df