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.
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 9
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: OpenNMT/OpenNMT-py
Commit Name: 63871d5ab3301d015805abddd8f4259680d6a24a
Time: 2017-09-21
Author: bpeters@coli.uni-saarland.de
File Name: translate.py
Class Name:
Method Name: main
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: CellProfiler/CellProfiler
Commit Name: c7e269042ea2e8c67e3d3d0ee2804535e326604d
Time: 2010-09-07
Author: leek@1fc53939-2000-0410-845c-e8453a809027
File Name: cellprofiler/modules/imagemath.py
Class Name: ImageMath
Method Name: visible_settings