The input table, customer_loyalty_newseq, is a collection of three new test sequences (seq_id 4, 5, 6) for user_id 1. HMMSupervisedLearner trained multiple users and obtained the trained model files (pi_loyalty, A_loyalty and B_loyalty). This example uses these model files with the input to determine the loyalty levels of customers from the new sequence of purchases. The loyalty levels are low (L), normal (N), and high (H).
id | user_id | seq_id | purchase_date | observation |
---|---|---|---|---|
301 | 1 | 4 | 2014-05-01 | LL |
302 | 1 | 4 | 2014-05-02 | LS |
303 | 1 | 4 | 2014-05-03 | SS |
304 | 1 | 4 | 2014-05-04 | SM |
305 | 1 | 4 | 2014-05-05 | LL |
306 | 1 | 4 | 2014-05-06 | ML |
307 | 1 | 4 | 2014-05-07 | SS |
308 | 1 | 4 | 2014-05-08 | MM |
309 | 1 | 4 | 2014-05-09 | MS |
310 | 1 | 4 | 2014-05-10 | ML |
311 | 1 | 5 | 2014-05-01 | ML |
312 | 1 | 5 | 2014-05-02 | SM |
313 | 1 | 5 | 2014-05-03 | MS |
314 | 1 | 5 | 2014-05-04 | MS |
315 | 1 | 5 | 2014-05-05 | SS |
316 | 1 | 5 | 2014-05-06 | MS |
317 | 1 | 5 | 2014-05-07 | ML |
318 | 1 | 5 | 2014-05-08 | MM |
319 | 1 | 5 | 2014-05-09 | SM |
320 | 1 | 5 | 2014-05-10 | SM |
321 | 1 | 6 | 2014-05-01 | SM |
322 | 1 | 6 | 2014-05-02 | MS |
323 | 1 | 6 | 2014-05-03 | SS |
324 | 1 | 6 | 2014-05-04 | LM |
325 | 1 | 6 | 2014-05-05 | SL |
326 | 1 | 6 | 2014-05-06 | SS |
327 | 1 | 6 | 2014-05-07 | SS |
328 | 1 | 6 | 2014-05-08 | SM |
329 | 1 | 6 | 2014-05-09 | LS |
330 | 1 | 6 | 2014-05-10 | LS |