1
$\begingroup$

I'm trying to create a feature for a churn model (binary classifier). The feature is mean of sales growth rates for several months. But if I just take the mean of sales for several months, I often get NAN or inf. since sales are often zeros. I could impute some numbers like 0 or mean as the missing sales but I feel I'm modifying the pattern/underling distribution. How would you go by creating such a feature for a classification model?

Thanks!

$\endgroup$
  • $\begingroup$ How can you get mean as NAN when some sales are zeros? Is it a normal mean or your formula for mean is different? $\endgroup$ – Ankit Seth Jul 19 '18 at 7:23
  • $\begingroup$ @AnkitSeth perhaps OP is referring to "mean of sales growth rates" here? $\endgroup$ – bradS Jul 19 '18 at 12:15
  • $\begingroup$ @bradS I am saying that if sales growth rates are finite values, how can their mean be non-finite? $\endgroup$ – Ankit Seth Jul 19 '18 at 12:20
  • $\begingroup$ You shouldn't be getting NANs on a mean function unless some of your values are NANs already. Have you scrubbed your data? $\endgroup$ – bstrain Jul 19 '18 at 14:37
  • $\begingroup$ I think it's entirely dependent on context. What is the feature supposed to measure, and what does a lack of sales indicate? Defining an empty mean to be zero seems like it could make sense here. Also, what about looking at sums instead of means? $\endgroup$ – dsaxton Jul 20 '18 at 23:38
1
$\begingroup$

Do you want to consider the missing sales values or not? If you do want to consider, impute them to 0. Or else, ensure that your mean calculation does not take them into consideration and only calculates mean over the other values.

|improve this answer|||||
$\endgroup$
1
$\begingroup$

It depends on how would you define sales growth from a business point of view. For example if you trying to detect sales peaks with considering zero sales as normal, you can fill zeroes, nans or infs with its most recent previous that has an ok number.

|improve this answer|||||
$\endgroup$

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.