Created
November 5, 2018 19:59
-
-
Save ajayborra/109ed33528560cff8d01a5b36d0b13f9 to your computer and use it in GitHub Desktop.
Feature Scaling
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
//Using Standard scaler to scale the feature set | |
val standardScaler = new StandardScaler() | |
.setInputCol("features") | |
.setOutputCol("scaledFeatures") | |
.setWithStd(true) | |
.setWithMean(true) | |
val scaler = standardScaler.fit(featuresDf) | |
val scaledFeatures = scaler.transform(featuresDf) | |
//print the output | |
scaledFeatures.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment