# Which Technique should we use for predicting an integer output?

I'm working on a problem where my target feature of type integer. i.e (n_clicks). In general, if we want to predict categorical target feature then we use classification algorithms and on the other hand for predicting a target feature of type continuous then we use regression techniques where my output will be -infinity to +infinity. But in my case if I use regression then my output will become a float value. One solution here would be convert the output float values into into integer or by use of pandas.round() to round figure the value.

Is there any alternative way to predict my output variable as an integer ?

Thanks

UPDATED: As suggested to use POISSON Regression, tried below code but still the output is same. Below is code snippet:

import statsmodels.api as sm
poisson_model = sm.GLM(y_train, x_train_sm, family=sm.families.Poisson()).fit()


If you are using a poisson regression model, this question might be better suited for cross-validated as it is a statistical model.

This appears to be related to the reason why you are getting floats instead of the expected integer value. Poisson regression returns the expected value, E[Y|X] which does not necessarily have to be an integer.

Poisson regression is an appropriate choice when the dependent variable is a count.

• tried that but it is also giving the same float values – Ravi Kumar B Sep 17 '19 at 9:36
• Please post your code – Brian Spiering Sep 17 '19 at 14:43
• The code is added to the question. – Ravi Kumar B Sep 18 '19 at 3:18