Prediction are all nan when objective is count:poisson


#1

I just use data from a csv and read it into X and y.

csv = pd.read_csv(path)
train_X = csv['features'...etc]
train_y = csv['hit']
model = xgb.XGBRegressor(n_estimators=1000, max_depth=6, objective='count:poisson').fit(train_X, train_y, xgb_model=None)
predict = model.predict(train_X)

predict:
[[nan nan nan ... nan nan nan]
 [nan nan nan ... nan nan nan]
 [nan nan nan ... nan nan nan]
 ...
 [nan nan nan ... nan nan nan]
 [nan nan nan ... nan nan nan]
 [nan nan nan ... nan nan nan]]

How come will happen this?


#2

Can you post your model and data?


#3

I try to predict io numbers of each block by regresion model.

Data:
ID,hit,day,week,date,mon
Day
0,22532,0,0,0,2
1,22572,0,0,0,2
2,20597,0,0,0,2
3,23219,0,0,0,2
4,18915,0,0,0,2
Day
0,22532,1,0,1,2
1,22572,1,0,1,2
2,20597,1,0,1,2
3,23219,1,0,1,2
4,18915,1,0,1,2

Features explanation:
ID means block number.
hit means io times(access times)
day for which day in adate week. 0 for Monday, 6 for Sunday.
week for week in the month. 0 for first week of the month.
date means number of the month. 25 means 24th day in the month.
mon means month. 11 for December. 0 for January.

train_X: ID, day, week, date, mon.
train_y: hit

I found someone will add bias into the train_X when specify the poisson regression, should I add?