Action Principale : bartScoreMargin
| 1 | PROC CAS; |
| 2 | LOADACTIONSET 'bart'; |
| 3 | |
| 4 | /* Generar datos de ejemplo */ |
| 5 | DATA mycas.sample; |
| 6 | DO i = 1 to 100; |
| 7 | x1 = rand('UNIFORM'); |
| 8 | x2 = rand('UNIFORM'); |
| 9 | y = 10 * sin(3.14 * x1 * x2) + 20 * (x2 - 0.5)**2 + 10 * x1 + 5 * x2 + rand('NORMAL', 0, 1); |
| 10 | OUTPUT; |
| 11 | END; |
| 12 | RUN; |
| 13 | |
| 14 | /* Entrenar el modelo BART */ |
| 15 | bart.bartGauss RESULT=res / |
| 16 | TABLE={name='sample'}, |
| 17 | inputs={{name='x1'}, {name='x2'}}, |
| 18 | target='y', |
| 19 | saveState={name='bart_model', replace=true}; |
| 20 | RUN; |
| 21 | QUIT; |