Created
May 22, 2019 16:03
-
-
Save anirudhev/49c2ead246273f625edf81c02f5837eb to your computer and use it in GitHub Desktop.
User Score Computation
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
// Spark : Train the model and save features, weights in PMML format | |
saveModelToS3(model.toPMML(), // PMML string | |
"miles_away_from_store", // Feature names | |
"trips_past_year", | |
"rewards_card_holder", | |
"lives_in_rural_area") | |
// Inside user-scoring microservice : Compute the user score | |
features = Map("miles_away_from_store" -> miles_away_from_store, | |
"card_holder" -> card_holder, | |
"lives_in_rural_area" -> lives_in_rural_area, | |
"trips_past_year" -> trips_past_year) | |
user_score = modelEvaluator.evaluate(features) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment