any idea what is wrong with this statement. I am just trying to get grades from three different tables and take an average of that. then assign a pass/fail based on the average value.
CREATE OR REPLACE MODEL `bqml_test.ModelTest`
OPTIONS(model_type='logistic_reg') AS
SELECT *,
AVG(combined.label) as average
CASE WHEN average > 0.4 then ‘pass’
ELSE ‘fail’
END as success
FROM (SELECT * FROM `interns2022.uniqueIdGrades.1617`
UNION ALL SELECT * FROM `interns2022.uniqueIdGrades.1718`
UNION ALL SELECT * FROM `interns2022.uniqueIdGrades.1819`
UNION ALL SELECT * FROM `interns2022.uniqueIdGrades.1920`)
CASE
WHEN
Course_Grade = "A" then 1
WHEN
Course_Grade = "B" then 0.8
WHEN
Course_Grade = "C" then 0.6
WHEN
Course_Grade = "D" then 0.4
WHEN
Course_Grade = "F" then 0.2
Else 0
End as label as combined
GROUP BY unique_identifier