Scénario de test & Cas d'usage
Simulation d'un parc client avec ancienneté, facture mensuelle et indicateur de churn.
| 1 | |
| 2 | DATA work.churn_data; |
| 3 | call streaminit(123); |
| 4 | DO i=1 to 1000; |
| 5 | tenure = rand('integer', 1, 72); |
| 6 | monthly_bill = rand('uniform', 30, 120); |
| 7 | IF rand('uniform') < 0.15 THEN churn='Yes'; |
| 8 | ELSE churn='No'; |
| 9 | OUTPUT; |
| 10 | END; |
| 11 | |
| 12 | RUN; |
| 13 |
| 1 | |
| 2 | PROC CAS; |
| 3 | upload path="%sysfunc(pathname(work))/churn_data.sas7bdat" casout={name="churn_data", replace=true}; |
| 4 | |
| 5 | QUIT; |
| 6 |
| 1 | |
| 2 | PROC CAS; |
| 3 | mlTools.crossValidate RESULT=r / kFolds=5 modelType="GRADBOOST" tableRedistUpPolicy="REBALANCE" trainOptions={TABLE={name="churn_data"}, target="churn", inputs={"tenure", "monthly_bill"}, nominals={"churn"}}; |
| 4 | PRINT r; |
| 5 | |
| 6 | QUIT; |
| 7 |
L'action doit produire une table de résultats affichant les métriques de performance (ex: erreur moyenne, erreurs de classification) moyennées sur les 5 plis, confirmant la stabilité du modèle Gradient Boosting.