Last active
March 11, 2016 08:04
-
-
Save puyokw/43591caed3785c5b1549 to your computer and use it in GitHub Desktop.
td_intern otto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- トレーニング | |
INSERT OVERWRITE TABLE model_cv | |
SELECT train_randomforest_classifier(features, label, '-trees 500') | |
FROM train_cv; | |
-- 予測 | |
INSERT OVERWRITE TABLE pred_cv | |
SELECT | |
t2.rowid as rowid, | |
t2.predicted.label as label, | |
t2.predicted.probability as probability, | |
t2.predicted.probabilities as probabilities | |
FROM( | |
SELECT | |
rowid as rowid, | |
rf_ensemble(predicted) as predicted | |
FROM ( | |
SELECT | |
t.rowid as rowid, t.label as actual, | |
-- hivemall v0.4.1-alpha.2 and before | |
-- tree_predict(p.model, t.features, ${classification}) as predicted | |
-- hivemall v0.4.1 and later | |
tree_predict(p.model_id, p.model_type, p.pred_model, t.features, true) as predicted | |
FROM model p | |
LEFT OUTER JOIN test_cv t | |
) t1 | |
group by | |
rowid | |
) t2; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment