Scénario de test & Cas d'usage
Training of classical artificial neural networks.
Discover all actions of neuralNetCreate a dataset of telecom customer profiles with features like contract type, monthly charges, tenure, and a binary churn indicator.
| 1 | DATA casuser.telecom_churn; |
| 2 | call streaminit(123); |
| 3 | DO i = 1 to 2000; |
| 4 | tenure = rand('INTEGER', 1, 72); |
| 5 | monthly_charges = 20 + rand('UNIFORM') * 100; |
| 6 | is_monthly_contract = rand('BERNOULLI', 0.55); |
| 7 | IF (tenure < 12 and monthly_charges > 70 and is_monthly_contract = 1) THEN DO; |
| 8 | churn = rand('BERNOULLI', 0.75); |
| 9 | END; |
| 10 | ELSE DO; |
| 11 | churn = rand('BERNOULLI', 0.1); |
| 12 | END; |
| 13 | OUTPUT; |
| 14 | END; |
| 15 | RUN; |
| 1 | PROC CAS; |
| 2 | neuralNet.annTrain / |
| 3 | TABLE={name='telecom_churn'}, |
| 4 | inputs={{name='tenure'}, {name='monthly_charges'}, {name='is_monthly_contract'}}, |
| 5 | target='churn', |
| 6 | arch='NEURAL', |
| 7 | hidden={{n=10, act='RELU'}}, |
| 8 | casOut={name='churn_model', replace=true}; |
| 9 | RUN; |
| 1 | PROC CAS; |
| 2 | neuralNet.annCode / |
| 3 | modelTable={name='churn_model'}, |
| 4 | code={casOut={name='churn_scoring_code', replace=true}}; |
| 5 | RUN; |
The action should successfully generate SAS DATA step code and store it in the `churn_scoring_code` table. The code should contain the logic to score new customers based on the trained churn model. A review of the output table should show the generated SAS code as a character variable, ready for deployment.