From 178517524fd983ff1672d8929bd68ecfb4a0d730 Mon Sep 17 00:00:00 2001 From: zhxfl <291221622@qq.com> Date: Tue, 26 Sep 2017 11:37:21 +0800 Subject: [PATCH] fix bug for demo/multiclass_classification/train.py (#2747) --- demo/multiclass_classification/train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/multiclass_classification/train.py b/demo/multiclass_classification/train.py index b4af52c99..6a43c6dee 100755 --- a/demo/multiclass_classification/train.py +++ b/demo/multiclass_classification/train.py @@ -47,5 +47,5 @@ bst = xgb.train(param, xg_train, num_round, watchlist) # get prediction, this is in 1D array, need reshape to (ndata, nclass) pred_prob = bst.predict(xg_test).reshape(test_Y.shape[0], 6) pred_label = np.argmax(pred_prob, axis=1) -error_rate = np.sum(pred != test_Y) / test_Y.shape[0] +error_rate = np.sum(pred_label != test_Y) / test_Y.shape[0] print('Test error using softprob = {}'.format(error_rate))