# What machine learning model would be the best fit for this problem [Sample Data-set and Plot Attached]?

So I've got a dataset that looks like:

Weight(KG)  Count
25          9
4           17
55          9
4           25
4           7
....
....


My aim is to find any relation between the weight and count and maybe predict count based on a given weight. I'm using Linear Regression (I don't know if this is the right way to go). Results were pretty disappointing:
Without label encoding (categorizing) and feature scaling (normalizing) the R squared metric was around 4%. With the encoding and scaling down it 'improved' to 6%.

My Regression plot looks like this ( X_train (weights) and Y_train (counts) ): I'm completely lost as to what model would actually give me some insight into this problem. So my questions are:

1. What model would work better for the given data and plot?
2. Should I convert the problem into some kind of classification problem and try to predict whether for a given weight the count is above, say, 20 ?
3. Should I try adding in more features and try my luck? If so, would it still be a regression problem?

I'd appreciate any comments on all these questions or even on a single one.

Thanks in advance. Much appreciated.

• It looks to me that without additional information in the model, with that much scatter in the data you will likely not improve the fit. If you have some other related data available it would probably help your modeling effort in this case. – James Phillips Mar 30 '18 at 9:09

## 1 Answer

I would try a Poisson Generalized Linear Model, also known as Poisson Regression. Most statistics packages should have it (for example in the Python package statsmodels you can find it for example under statsmodels.api.Poisson)

A short explanation. When you're using "the usual" regression what you're doing is assuming that the errors around the mean are normally distributed. Since you have count data that assumption is obviously wrong (because normally distributed is continuous and can be negative, whereas count data must be non-negative integer). Unlike the normal distribution, the Poisson distribution only has non-negative integer outcomes. In a sense Poisson regression is the closest thing to "the usual" regression that makes sense for count data.