0
$\begingroup$

I am trying to predict customer spending for an X year period after t0. I train an svm model with transactions occurring before and on t0, on the cumulative spending of the customers after t0. I then use the model to make predictions on a test data set to assess the models accuracy. The test dataset is from 1 period (in the example below 1 day) in the future. How does an svm deal with newly acquired customers?

Question elaboration:

My training data is structured as follows:

>DT1
   Id t.-3 t.-2 t.-1 t.0 Target.spending
1:  1   29   25   14  25             100
2:  2   NA   30    0   0               0
3:  3   NA   16    0  13               0
4:  4   NA   NA   62  18               5

Customer 1 was acquired on t.-3 when he purchased worth 29$. His second purchase occurred on t.-2. etc... Customer 2 was acquired on t.-2 and only purchased on that day. Target.spending is the cumulative spending that occurred in the next four days (i.e. t.1+t.2+t.3+t.4).

Then, I predict the spending of the next four days using an svm:

train.model <- svm(Target.spending ~ . , data = DT)

Using a test data set from one day in the future (where t.0 (DT1) = t.-1 (DT2)), I will predict the target.spending (DT2) and assess the model accuracy. In the test data, on t.0 (DT2), customer 5 was acquired.

>DT2
   Id t.-3 t.-2 t.-1 t.0 Target.spending
1:  1   25   14   25  10             103
2:  2   30    0    0   0               0
3:  3   16    0   13   0               0
4:  4   NA   62   18   4               1
5:  5   NA   NA   NA   9              30

How does the svm deal with new customer acquisitions?

$\endgroup$

1 Answer 1

0
$\begingroup$

It has been a while since I used it, but I am pretty sure you have add a parameter when running the training to say that you have a regression problem not a classification problem.

I also think SVM will just interpret NA as 0 and push that through the projection. So it will interpret a new customer the same way as an old one, who did not buy anything in all your time periods.

Hope that helps.

$\endgroup$
1
  • $\begingroup$ What if I use Id as an independent variable? The model is trained on Id (factor) with 4 levels (1,2,3,4) but the test dataset has 5 levels (1,2,3,4,5). How will the effect of the 5th customer be taken into consideration? (This is not so relevant when each customer has 1 row, but when I introduce lagged data each customer will have multiple rows) $\endgroup$
    – greyBag
    Commented Jul 14, 2015 at 11:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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