-
Notifications
You must be signed in to change notification settings - Fork 28.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-13512] [ML] add example and doc for MaxAbsScaler #11392
Conversation
Test build #52048 has finished for PR 11392 at commit
|
Test build #52049 has finished for PR 11392 at commit
|
|
||
import org.apache.spark.SparkConf; | ||
import org.apache.spark.api.java.JavaSparkContext; | ||
import org.apache.spark.ml.feature.MaxAbsScaler; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we have $example on$
here (to match the JavaMinMaxScalerExample
), i.e.
// $example on$
import org.apache.spark.ml.feature.MaxAbsScaler;
import org.apache.spark.ml.feature.MaxAbsScalerModel;
import org.apache.spark.sql.DataFrame;
// $example off$
@hhbyyh ping |
// Compute summary statistics and generate MaxAbsScalerModel | ||
MaxAbsScalerModel scalerModel = scaler.fit(dataFrame); | ||
|
||
// rescale each feature to range [min, max]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[min, max]
should be [-1, 1]
.
@MLnick Thanks for helping review. Updated according to the comments. |
Test build #52836 has finished for PR 11392 at commit
|
Thanks! Merging to master. |
…xAbsScaler example ## What changes were proposed in this pull request? Fix build failure introduced in #11392 (change `DataFrame` -> `Dataset<Row>`). ## How was this patch tested? Existing build/unit tests Author: Nick Pentreath <nick.pentreath@gmail.com> Closes #11653 from MLnick/java-maxabs-example-fix.
## What changes were proposed in this pull request? jira: https://issues.apache.org/jira/browse/SPARK-13512 Add example and doc for ml.feature.MaxAbsScaler. ## How was this patch tested? unit tests Author: Yuhao Yang <hhbyyh@gmail.com> Closes apache#11392 from hhbyyh/maxabsdoc.
…xAbsScaler example ## What changes were proposed in this pull request? Fix build failure introduced in apache#11392 (change `DataFrame` -> `Dataset<Row>`). ## How was this patch tested? Existing build/unit tests Author: Nick Pentreath <nick.pentreath@gmail.com> Closes apache#11653 from MLnick/java-maxabs-example-fix.
What changes were proposed in this pull request?
jira: https://issues.apache.org/jira/browse/SPARK-13512
Add example and doc for ml.feature.MaxAbsScaler.
How was this patch tested?
unit tests