Input
The input table, computers_category, has five attributes of personal computers—price, speed, hard disk size, RAM, and screen size. The table has 500 rows, categorized into five price groups—SPECIAL, SUPER, HYPER, MEGA and UBER. The predicted_compcategory values can be output by a classification function, such as KNN (ML Engine).
compid | price | speed | hd | ram | screen | expected_compcategory | predicted_compcategory |
---|---|---|---|---|---|---|---|
1 | 1499 | 25 | 80 | 4 | 14 | SPECIAL | SPECIAL |
2 | 1795 | 33 | 85 | 2 | 14 | SUPER | SUPER |
3 | 1595 | 25 | 170 | 4 | 15 | SPECIAL | SPECIAL |
4 | 1849 | 25 | 170 | 8 | 14 | SUPER | HYPER |
5 | 3295 | 33 | 340 | 16 | 14 | HYPER | SUPER |
6 | 3695 | 66 | 340 | 16 | 14 | UBER | SPECIAL |
7 | 1720 | 25 | 170 | 4 | 14 | SPECIAL | SPECIAL |
8 | 1995 | 50 | 85 | 2 | 14 | SUPER | SUPER |
9 | 2225 | 50 | 210 | 8 | 14 | SUPER | SUPER |
12 | 2605 | 66 | 210 | 8 | 14 | MEGA | UBER |
13 | 2045 | 50 | 130 | 4 | 14 | SUPER | SUPER |
14 | 2295 | 25 | 245 | 8 | 14 | MEGA | MEGA |
16 | 2225 | 50 | 130 | 4 | 14 | SUPER | SUPER |
... | ... | ... | ... | ... | ... | ... | ... |
SQL Call
SELECT * FROM FMeasure( ON computers_category PARTITION BY 1 USING ObservationColumn ('expected_compcategory') PredictColumn ('predicted_compcategory') Beta (1.0) ) AS dt;
Output
class precision recall beta fmeasure ------- ------------------ ------------------ ---- ------------------ hyper 0.9368421052631579 0.89 1.0 0.9128205128205129 mega 0.9230769230769231 0.935064935064935 1.0 0.9290322580645162 special 0.84375 0.8852459016393442 1.0 0.864 super 0.9358974358974359 0.954248366013072 1.0 0.9449838187702266 uber 0.896551724137931 0.8125 1.0 0.8524590163934426 -AVG- 0.918 0.918 1.0 0.918
Download a zip file of all examples and a SQL script file that creates their input tables.