Skip to content

Instantly share code, notes, and snippets.

@anirudhev
Created May 22, 2019 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anirudhev/49c2ead246273f625edf81c02f5837eb to your computer and use it in GitHub Desktop.
Save anirudhev/49c2ead246273f625edf81c02f5837eb to your computer and use it in GitHub Desktop.
User Score Computation
// 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