Skip to content

Instantly share code, notes, and snippets.

@myui
Created October 29, 2016 00:27
Show Gist options
  • Save myui/0c67df3037039aa274b239ea2e415007 to your computer and use it in GitHub Desktop.
Save myui/0c67df3037039aa274b239ea2e415007 to your computer and use it in GitHub Desktop.
context = HiveContext(sc)
context.sql("
SELECT
feature, avg(weight) as weight
FROM (
SELECT train_logregr(features, label)
as (feature, weight)
FROM trainTable
) model
GROUP BY feature
")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment