-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevaluate_models.sql
51 lines (50 loc) · 997 Bytes
/
evaluate_models.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
-- Evaluating the models
SELECT
roc_auc,
CASE
WHEN roc_auc > .9 THEN 'Good'
WHEN roc_auc > .8 THEN 'Fair'
WHEN roc_auc > .7 THEN 'Decent'
WHEN roc_auc > .6 THEN 'Not Good'
ELSE 'Poor'
END AS Model_Quality
FROM
ML.EVALUATE(MODEL loan.model, (
SELECT
*
FROM
`loan.train_clean`
));
SELECT
roc_auc,
CASE
WHEN roc_auc > .9 THEN 'Good'
WHEN roc_auc > .8 THEN 'Fair'
WHEN roc_auc > .7 THEN 'Decent'
WHEN roc_auc > .6 THEN 'Not Good'
ELSE 'Poor'
END AS Model_Quality
FROM
ML.EVALUATE(MODEL loan.model1, (
SELECT
*
FROM
`loan.train_clean`
));
-- Evaluating the models
SELECT
roc_auc,
CASE
WHEN roc_auc > .9 THEN 'Good'
WHEN roc_auc > .8 THEN 'Fair'
WHEN roc_auc > .7 THEN 'Decent'
WHEN roc_auc > .6 THEN 'Not Good'
ELSE 'Poor'
END AS Model_Quality
FROM
ML.EVALUATE(MODEL loan.model3, (
SELECT
*
FROM
`loan.train_clean`
));