From 9d627e2567b6a82823451108a812b2c2e8311044 Mon Sep 17 00:00:00 2001 From: terrytangyuan Date: Sun, 4 Oct 2015 23:26:46 -0500 Subject: [PATCH] DOC: Updated contributors.md --- CONTRIBUTORS.md | 3 ++- tests/python/test_early_stopping.py | 17 +++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 32a6745f0..48b1b2032 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -33,8 +33,9 @@ List of Contributors - Skipper is the major contributor to the scikit-learn module of xgboost. * [Zygmunt ZajÄ…c](https://github.com/zygmuntz) - Zygmunt is the master behind the early stopping feature frequently used by kagglers. -* [Ajinkya Kale](https://github.com/ajkl) * [Yuan Tang](https://github.com/terrytangyuan) + - Yuan is the major contributor to unit tests in R and Python. +* [Ajinkya Kale](https://github.com/ajkl) * [Boliang Chen](https://github.com/cblsjtu) * [Vadim Khotilovich](https://github.com/khotilov) * [Yangqing Men](https://github.com/yanqingmen) diff --git a/tests/python/test_early_stopping.py b/tests/python/test_early_stopping.py index ee6f1a360..9f0050a5d 100644 --- a/tests/python/test_early_stopping.py +++ b/tests/python/test_early_stopping.py @@ -1,9 +1,14 @@ import xgboost as xgb +from sklearn.datasets import load_digits +from sklearn.cross_validation import KFold, train_test_split +def test_early_stopping_nonparallel(): + digits = load_digits(2) + X = digits['data'] + y = digits['target'] + X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0) + clf = xgb.XGBClassifier() + clf.fit(X_train, y_train, early_stopping_rounds=10, eval_metric="auc", + eval_set=[(X_test, y_test)]) -X = digits['data'] -y = digits['target'] -X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0) -clf = xgb.XGBClassifier() -clf.fit(X_train, y_train, early_stopping_rounds=10, eval_metric="auc", - eval_set=[(X_test, y_test)]) +# todo: parallel test for early stopping