fix VisibleDeprecationWarning
This commit is contained in:
parent
840481d215
commit
bf24d6ae98
@ -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):
|
||||
|
||||
@ -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]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user