This repository has been archived by the owner on Sep 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 118
[HIVEMALL-127] Added tree_predict_v1 UDF for RandomForest backward compatibility #102
Closed
Conversation
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
myui
changed the title
[HIVEMALL-127][Improvement] Added tree_predict_v1 UDF for RandomForest backward compatibility
[HIVEMALL-127] Added tree_predict_v1 UDF for RandomForest backward compatibility
Jul 18, 2017
Need to fix the following error: create table predicted_rf_old
as
SELECT
passengerid,
predicted.label,
predicted.probability,
predicted.probabilities
FROM (
SELECT
passengerid,
rf_ensemble(predicted) as predicted
-- hivemall v0.5-rc.1 or later
-- rf_ensemble(predicted.value, predicted.posteriori, model_weight) as predicted
-- rf_ensemble(predicted.value, predicted.posteriori) as predicted -- avoid OOB accuracy (i.e., model_weight)
FROM (
SELECT
t.passengerid,
-- hivemall v0.4.1-alpha.2 or before
-- tree_predict(p.model, t.features, ${classification}) as predicted
-- hivemall v0.4.1-alpha.3 or later
-- tree_predict(p.model_id, p.model_type, p.pred_model, t.features, ${classification}) as predicted
-- hivemall v0.5-rc.1 or later
-- p.model_weight,
-- tree_predict(p.model_id, p.model, t.features, ${classification}) as predicted
tree_predict_v1(p.model_id, p.model_type, p.pred_model, t.features, ${classification}) as predicted -- to use the old model in v0.5-rc.1 or later
FROM (
SELECT
-- model_id, model
-- hivemall v0.4.1-alpha.3 or later
model_id, -3 as model_type, model as pred_model
-- hivemall v0.5-rc.1 or later
-- model_id, model_weight, model
FROM
model_rf
DISTRIBUTE BY rand(1)
) p
LEFT OUTER JOIN test_rf t
) t1
group by
passengerid
) t2
;
|
1 similar comment
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Added
tree_predict_v1
UDF for RandomForest backward compatibilityWhat type of PR is it?
Improvement
What is the Jira issue?
https://issues.apache.org/jira/browse/HIVEMALL-127
How was this patch tested?
unit tests, manual tests
How to use this feature?
Remaining tasks
mvn formatter:format
, for your commit?rf_ensemble()
to accept the old style argument