Skip to content

Instantly share code, notes, and snippets.

@diana-shealy
Created April 7, 2016 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diana-shealy/3f04f25271dcdc2cbb671c4e5f61d527 to your computer and use it in GitHub Desktop.
Save diana-shealy/3f04f25271dcdc2cbb671c4e5f61d527 to your computer and use it in GitHub Desktop.
Create the Predictions
INSERT OVERWRITE TABLE prediction
SELECT
id,
EXP(predicted)-1 as predicted
FROM(
SELECT
id,
avg(predicted) AS predicted
FROM(
SELECT
t.id,
tree_predict(p.model_id, p.model_type, p.pred_model, t.features, false) as predicted
FROM
model p
LEFT OUTER JOIN testing3 t
) t1
group by
id
) t2;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment