555cc61146ae28d1ddd7e396f1afdc0a81a3d964,aif360/sklearn/tests/test_reweighing.py,,test_gridsearch,#,44
Before Change
clf = GridSearchCV(rew, params, cv=5)
// TODO: "groups" name clashes with CV splitter
fit_params = {"pa_groups": X.index.get_level_values("sex"),
"sample_weight": np.random.random(y.shape)}
clf.fit(X, y, **fit_params)
// print(clf.score(X, y))
assert len(clf.best_estimator_.reweigher_.groups_) == 2
After Change
return accuracy_score(y_true, y_pred, sample_weight=sample_weight[idx])
scoring = make_scorer(score_func, **{"sample_weight": sample_weight})
params = {"estimator__C": [1, 10], "reweigher__prot_attr": ["sex"]}
clf = GridSearchCV(rew, params, scoring=scoring, cv=5, iid=False)
clf.fit(X, y, **{"sample_weight": sample_weight})
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: IBM/AIF360
Commit Name: 555cc61146ae28d1ddd7e396f1afdc0a81a3d964
Time: 2020-02-19
Author: hoffman.sc@gmail.com
File Name: aif360/sklearn/tests/test_reweighing.py
Class Name:
Method Name: test_gridsearch
Project Name: cesium-ml/cesium
Commit Name: af3a64a72b212bf1e05383bc5c7a252b6347a4b0
Time: 2016-11-21
Author: brettnaul@gmail.com
File Name: cesium/tests/test_predict.py
Class Name:
Method Name: test_model_regression
Project Name: nipy/dipy
Commit Name: 2212633aae0a4b3498d0d5f8d7bad76b9c5080c1
Time: 2018-12-08
Author: skab12@gmail.com
File Name: dipy/tracking/tests/test_utils.py
Class Name:
Method Name: _target