From 586d6ae740e1c29715df5480d06f69502a6e0d63 Mon Sep 17 00:00:00 2001 From: Tianqi Chen Date: Wed, 3 Sep 2014 22:05:56 -0700 Subject: [PATCH] Update basic_walkthrough.py --- demo/guide-python/basic_walkthrough.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/demo/guide-python/basic_walkthrough.py b/demo/guide-python/basic_walkthrough.py index f542954ce..62c3fc010 100755 --- a/demo/guide-python/basic_walkthrough.py +++ b/demo/guide-python/basic_walkthrough.py @@ -60,7 +60,8 @@ watchlist = [(dtest,'eval'), (dtrain,'train')] bst = xgb.train( param, dtrain, num_round, watchlist ) print ('start running example of build DMatrix from numpy array') -# NOTE: npymat is numpy array, we will convert it into scipy.sparse.csr_matrix in internal implementation,then convert to DMatrix +# NOTE: npymat is numpy array, we will convert it into scipy.sparse.csr_matrix in internal implementation +# then convert to DMatrix npymat = csr.todense() dtrain = xgb.DMatrix( npymat) dtrain.set_label(labels)