Update basic_walkthrough.py
This commit is contained in:
parent
d4b62e679d
commit
586d6ae740
@ -60,7 +60,8 @@ watchlist = [(dtest,'eval'), (dtrain,'train')]
|
|||||||
bst = xgb.train( param, dtrain, num_round, watchlist )
|
bst = xgb.train( param, dtrain, num_round, watchlist )
|
||||||
|
|
||||||
print ('start running example of build DMatrix from numpy array')
|
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()
|
npymat = csr.todense()
|
||||||
dtrain = xgb.DMatrix( npymat)
|
dtrain = xgb.DMatrix( npymat)
|
||||||
dtrain.set_label(labels)
|
dtrain.set_label(labels)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user