FMeasure Example 1: Output All Classes - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
8.00
1.0
Published
May 2019
Language
English (United States)
Last Update
2019-11-22
dita:mapPath
blj1506016597986.ditamap
dita:ditavalPath
blj1506016597986.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantage™

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.

computers_category
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
  ObsColumn ('expected_compcategory')
  PredictColumn ('predicted_compcategory')
  Beta (1.0)
) AS dt;

Output

class precision recall beta fmeasure
HYPER 0.936842105263158 0.89 1 0.912820512820513
MEGA 0.923076923076923 0.935064935064935 1 0.929032258064516
SPECIAL 0.84375 0.885245901639344 1 0.864
SUPER 0.935897435897436 0.954248366013072 1 0.944983818770227
UBER 0.896551724137931 0.8125 1 0.852459016393443
-AVG- 0.918 0.918 1 0.918