Input
- Input table: housing_data, as in the Linear Regression Example
- Model table: LinRegModel, is the output of the Linear Regression Example, created as follows:
CREATE MULTISET TABLE LinRegModel AS (
SELECT * FROM LinReg (
ON LinRegInternal (
ON housing_data
) AS dt1 PARTITION BY 1
) AS dt2
) WITH DATA;
SQL Call
SELECT * FROM LinRegPredict (
ON housing_data AS "input" PARTITION BY ANY
ON LinRegModel AS model DIMENSION
USING
InputColumns ('housesize','lotsize','bedrooms','granite','upgradedbathroom')
Accumulate ('housesize','lotsize','bedrooms','granite','upgradedbathroom')
) AS dt ORDER BY 1;
Output
housesize |
lotsize |
bedrooms |
granite |
upgradedbathroom |
predicted_value |
2200 |
9600 |
4 |
0 |
1 |
200178.653244499 |
2397 |
14156 |
4 |
1 |
0 |
187694.857118394 |
2983 |
9365 |
5 |
0 |
1 |
221896.997176442 |
3198 |
9669 |
5 |
1 |
1 |
225173.250343267 |
3247 |
10061 |
5 |
1 |
1 |
226336.77540032 |
3529 |
9191 |
6 |
0 |
0 |
207205.142881606 |
3536 |
19994 |
6 |
1 |
1 |
325768.367481286 |
4032 |
10150 |
5 |
0 |
1 |
198619.206697454 |