fix VisibleDeprecationWarning

This commit is contained in:
Shayne Kang 2016-05-08 01:44:04 +09:00
parent 840481d215
commit bf24d6ae98
2 changed files with 3 additions and 2 deletions

View File

@ -904,7 +904,8 @@ class Booster(object):
preds = preds.astype(np.int32)
nrow = data.num_row()
if preds.size != nrow and preds.size % nrow == 0:
preds = preds.reshape(nrow, preds.size / nrow)
ncol = int(preds.size / nrow)
preds = preds.reshape(nrow, ncol)
return preds
def save_model(self, fname):

View File

@ -269,7 +269,7 @@ def mknfold(dall, nfold, param, seed, evals=(), fpreproc=None, stratified=False,
if stratified is False and folds is None:
randidx = np.random.permutation(dall.num_row())
kstep = len(randidx) / nfold
kstep = int(len(randidx) / nfold)
idset = [randidx[(i * kstep): min(len(randidx), (i + 1) * kstep)] for i in range(nfold)]
elif folds is not None:
idset = [x[1] for x in folds]