0
$\begingroup$

I am currently working on a dataset having 10 features and one continuous target variable. One of the features is 'Country' , in which there are seven unique values [Argentina ,Denmark , France...etc].

Now , the continuous target variable is sales of a given product in that particular country for a given month in a given year.

It has been given in the problem statement , that the Sales have been taken in the local currency of that country , so now I have values on different scales and I am not sure how to deal with them.

When I grouped the data as per the different countries , (using pandas's groupby function) , I got at least 1000 observations for each country. So maybe I could train a model separately for each country ? All kind of approaches will be appreciated.

$\endgroup$
0
$\begingroup$

It depends on what you want to model. To model local effects, you can leave the target as is and train separate models for each country. If you are interested in how some factors may be correlating with increased/decreased sales in all countries, you could one-hot encode the 'Country' feature and fit the model to your full dataset. The 'Country' contribution should then be essentially the intercept needed to adjust the target for that country.

You may want to consider taking a logarithm of the sales, as you probably care more about the percentage change in the target rather than absolute change. Also, depending on what drives Sales, you may want to consider converting them to a common currency, e.g. USD - depending on whether they are more stable in local currency or in USD.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ I converted them to a common currency and am now getting improved results. But there is a problem , around 1000 of the sales values are negative and 5000 of them are zero. How do I deal with this? $\endgroup$ – Faraz Gerrard Jamal Jul 23 '18 at 11:34
  • $\begingroup$ It really depends on why they are negative/zero and what you are trying to model. $\endgroup$ – rinspy Jul 23 '18 at 13:09
  • $\begingroup$ I am trying to predict the sales, so negative could possibly mean the seller incurred losses. While zero could mean , the products were not sold or no net loss. I am thinking of making a separate classifier to first predict whether the product got positive sales or negative sales.Then run a regressor to predict the sales. But the problem is that the negative sales predictions are far less in number to the positive sales ones. $\endgroup$ – Faraz Gerrard Jamal Jul 23 '18 at 13:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.