Example: TD_GLMPredict Using Credit Data
This example takes credit data and uses TD_GLM function to get a model. You can view the input and output in the TD_GLM example.
TD_GLMPredict Call for Credit Data
CREATE VOLATILE TABLE vt_glm_predict_credit_ex AS ( SELECT * from TD_GLMPredict ( ON credit_ex_merged AS INPUTTABLE ON td_glm_output_credit_ex AS Model DIMENSION USING IDColumn ('ID') Accumulate('Outcome') ) AS dt ) WITH DATA ON COMMIT PRESERVE ROWS;
TD_GLMPredict Output for Credit Data
ID | Prediction | Outcome |
---|---|---|
61 | 1 | 1 |
297 | 0 | 0 |
631 | 0 | 0 |
122 | 1 | 1 |
... | ... | ... |
Example: TD_GLMPredict Using Housing Data
This example takes raw housing data, and does the following:
- Uses TD_ScaleFit to standardize the data.
- Uses TD_ScaleTransform to transform the data.
- Uses TD_GLM to get a model.
- Uses TD_GLMPredict to predict target values.
You can view the input and output of steps 1 through 3 in the TD_GLM example.
TD_GLMPredict Call for Housing Data
CREATE VOLATILE TABLE vt_predict_cal_ex AS ( SELECT * from TD_GLMPredict ( ON cal_housing_ex_scaled AS INPUTTABLE ON td_glm_cal_ex AS Model DIMENSION USING IDColumn ('ID') Accumulate('MedHouseVal') ) AS dt ) WITH DATA ON COMMIT PRESERVE ROWS;
TD_GLMPredict Output for Housing Data
ID | Prediction | MedHouseVal |
---|---|---|
2833 | 1.5762 | 0.6 |
5328 | 2.29801 | 2.775 |
5300 | 1.82705 | 3.5 |
12433 | 0.863867 | 0.664 |
... | ... | ... |