commit | 028306e77cba45e587429412405b71339cab411b | [log] [tgz] |
---|---|---|
author | Makoto Yui <myui@apache.org> | Fri Jun 28 03:02:38 2019 +0900 |
committer | Makoto Yui <myui@apache.org> | Fri Jun 28 03:02:38 2019 +0900 |
tree | 34d234f1fa121219fa339d67dafc7a6bcdd479b5 | |
parent | 8c3631df038c4550de22b92c47b160f8881c25f7 [diff] |
[HIVEMALL-259][DOC] Refactor feature_binning UDF ## What changes were proposed in this pull request? Refactor feature_binning UDF and update the function usage ## What type of PR is it? Documentation, Refactoring ## What is the Jira issue? https://issues.apache.org/jira/browse/HIVEMALL-259 ## How was this patch tested? unit tests, manual tests on EMR ## How to use this feature? ``` WITH extracted as ( select extract_feature(feature) as index, extract_weight(feature) as value from input l LATERAL VIEW explode(features) r as feature ), mapping as ( select index, build_bins(value, 5, true) as quantiles -- 5 bins with auto bin shrinking from extracted group by index ), bins as ( select to_map(index, quantiles) as quantiles from mapping ) select l.features as original, feature_binning(l.features, r.quantiles) as features from input l cross join bins r ``` see https://gist.github.com/myui/f943fa3ce1a7e1ac3f2dd9a7f9fa703b ## Checklist (Please remove this section if not needed; check `x` for YES, blank for NO) - [x] Did you apply source code formatter, i.e., `./bin/format_code.sh`, for your commit? - [x] Did you run system tests on Hive (or Spark)? Author: Makoto Yui <myui@apache.org> Closes #195 from myui/HIVEMALL-259.
Apache Hivemall is a scalable machine learning library that runs on Apache Hive, Apache Spark, and Apache Pig. Hivemall is designed to be scalable to the number of training instances as well as the number of training features.
Find more examples on our user guide and find a brief introduction to Hivemall in this slide.
Support is through user@hivemall.incubator.apache.org, not by a direct e-mail.
If you are planning to contribute to this repository, we first request you to create an issue at our JIRA page even if the topic is not related to source code itself (e.g., documentation, new idea and proposal).
All Hivemall functions are defined under resources/ddl. In order to update the definition files, the following script helps inserting function name and class path of your new UDF:
$ ./bin/update_ddls.sh
Moreover, don't forget to update function list in the document as well:
$ ./bin/update_func_md.sh
Note that, before creating a pull request including Java code, please make sure your code follows our coding conventions by applying formatter:
$ ./bin/format_code.sh