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, |
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
log_it = -0.20 + | |
0.44*miles_away_from_store + | |
0.14*trips_past_year + | |
0.34*rewards_card_holder + | |
0.35*lives_in_rural_area | |
and user_score = 1/(1+e^(-log_it)) |