Created
November 4, 2019 07:31
-
-
Save lakshay-arora/122e325d70f2f8efe30bcf0194f461d2 to your computer and use it in GitHub Desktop.
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
# create a sample data without the labels | |
sample_data_test = spark.createDataFrame([ | |
(3.0, 'Z', 'S10', 40), | |
(1.0, 'X', 'E10', 20), | |
(4.0, 'A', 'S20', 10), | |
(3.0, 'A', 'S10', 20), | |
(4.0, 'X', 'D10', 30), | |
(1.0, 'Z', 'E10', 20), | |
(4.0, 'A', 'S10', 30), | |
], ['feature_1', 'feature_2', 'feature_3', 'feature_4']) | |
# transform the data using the pipeline | |
sample_data_test = model.transform(sample_data_test) | |
# see the prediction on the test data | |
sample_data_test.select('features', 'rawPrediction', 'probability', 'prediction').show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment