Scénario de test & Cas d'usage
Create a dataset representing web sessions. 'session_id' groups the actions, 'timestamp' orders them, and 'page' is the item.
| 1 | |
| 2 | DATA mycas.web_navigation; |
| 3 | LENGTH page $20; |
| 4 | INPUT session_id timestamp page $; |
| 5 | CARDS; |
| 6 | 1 10 Home 1 20 Search 1 30 AddToCart 1 40 Checkout 2 10 Home 2 50 Checkout 3 10 Home 3 20 Search 3 25 ProductView 3 60 Checkout 4 15 Search 4 20 ProductView 5 10 Home 5 12 Search 5 40 AddToCart 5 45 Checkout ; |
| 7 | |
| 8 | RUN; |
| 9 |
| 1 | |
| 2 | PROC CAS; |
| 3 | sequence.cspade / TABLE={name='web_navigation'} sequenceId='session_id' eventId='timestamp' itemId='page' support=0.4 casout={name='common_paths', replace=true}; |
| 4 | |
| 5 | RUN; |
| 6 |
The output table 'common_paths' should contain frequent sequences such as 'Search -> Checkout' or 'Home -> Search', helping to identify the critical steps in the customer journey.