SlideShare uma empresa Scribd logo
1 de 17
Baixar para ler offline
Wave	
  Analy*cs:	
  	
  
Developing	
  Predic*ve	
  Business	
  Intelligence	
  Apps	
  
Built	
  on	
  the	
  Salesforce1™	
  Pla?orm	
  
Quote	
   Contract	
   Revenue	
  Opportunity	
   ERP	
  
CONTRACT	
  
LIFECYCLE	
  
MANAGEMENT	
  
ORDER	
  
MANAGEMENT	
  CONFIGURE	
  
PRICE	
  
QUOTE	
   BILLING	
  
REBATE	
  
MANAGEMENT	
  
DEAL	
  MANAGEMENT	
  
E-­‐COMMERCE	
  
QUOTE-­‐TO-­‐CASH	
  INTELLIGENCE	
  
	
  	
  	
  X-­‐AUTHOR	
  
ApQus	
  Quote-­‐to-­‐Cash	
  Footprint	
  
Why	
  Predic*ve	
  is	
  Important…	
  
• IoT	
  and	
  the	
  Age	
  of	
  Data	
  
• New	
  Tools	
  are	
  needed	
  	
  
•  Descrip7ve	
  
•  Predic7ve	
  
•  Prescrip7ve	
  Analy7cs	
  
• Ac7on	
  from	
  Insight	
  
The	
  Ways	
  Wave	
  helps…	
  
• Visualizing	
  descrip7ve	
  and	
  predic7ve	
  analysis	
  
• Delivering	
  insights	
  to	
  Salesforce	
  users	
  
If	
  you	
  have	
  one	
  of	
  these…..	
  
	
  
	
  
	
  
Then	
  you	
  might	
  like	
  these…	
  
Story:	
  Growing	
  Revenue	
  and	
  Margin	
  	
  
•  Business	
  wants	
  to	
  grow	
  revenue	
  with	
  cross-­‐sell	
  and	
  up-­‐sell	
  
recommenda7ons	
  based	
  on	
  data	
  analysis	
  
•  Marke7ng	
  uses	
  Wave	
  to	
  es7mate	
  the	
  poten7al	
  opportunity	
  
•  Sales	
  rep	
  receives	
  a	
  recommenda7on	
  for	
  her	
  customer	
  from	
  ApHus	
  that	
  will	
  
increase	
  the	
  size	
  of	
  the	
  deal	
  
•  Wave	
  provides	
  the	
  Sales	
  rep	
  with	
  addi7onal	
  insight	
  into	
  the	
  
recommenda7on	
  for	
  the	
  customer	
  which	
  helps	
  her	
  be	
  more	
  consulta7ve	
  
•  Marke7ng	
  uses	
  Wave	
  to	
  track	
  the	
  business	
  impact	
  of	
  the	
  	
  recommenda7ons	
  
which	
  convert	
  into	
  sales	
  	
  
Demonstra*on	
  
Add	
  Products	
  to	
  Cart	
  
Browse	
  Recommended	
  
Products	
  
Adds	
  Recommended	
  
Products	
  to	
  Cart	
  
Analyze	
  Purchase	
  
History	
  of	
  Similar	
  
Customers	
  	
  	
  
Predict	
  Recommended	
  
Products	
  
ApQus	
  Use	
  Case	
  
Display	
  chart	
  depic7ng	
  
Recommended	
  Products	
  by	
  
Customer	
  cluster	
  
Display	
  chart	
  depic7ng	
  	
  $	
  
from	
  Recommenda7ons	
  
added	
  to	
  cart	
  
Salesforce	
  
Database	
  
Frequency	
  
Similarity	
  
Predic7on	
  
Marke7ng	
  
Sales	
  
Wave	
  
Database	
  
Explain	
  Product	
  
Recommenda7ons	
  
Wave	
  API	
  
Recommender	
  API	
  
ApHus	
  CPQ	
  
ApHus	
  Cross-­‐Sell	
  	
  
Recommender	
  
Wave	
  
Machine-­‐Learning	
  Algorithm	
  
Algorithm
–  ML uses statistics to analyze and predict patterns in data
–  Item-based Collaborative Filtering
–  Initial model developed in “R” uses KNN (K Nearest Neighbor)
–  3 main components of the algorithm
▪  Frequency
▪  Similarity
▪  Prediction
–  Capable of unsupervised learning
Frequency Table
–  Count number of Products (items) purchased by each Account
Compute	
  
	
  	
  
	
  	
  
	
  	
  
Recommenda*on	
  
•  Select products (items) which are similar to the product added to the Cart
•  Given an account, choose top-N products among the similar products based on
the estimated rates
•  Products 15 & 20 are recommended to the user
Added Product 1
to the Cart
Similar Products
Product 3
Product 8
Product 10
Product 15
Product 20
User
Prediction Rate
0.5
1
0.3
2
3
User
The	
  Code	
  
public void callWaveAPI() {
Http http = new Http();
HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
// Wave REST API calls
String WAVE_BASE = 'https://gs0.salesforce.com/services/data/v34.0/wave';
String WAVE_DATASETS = WAVE_BASE + '/datasets';
String WAVE_QUERY = WAVE_BASE + '/query';
try {
// send Wave API request to query dataset
req = new HttpRequest();
// set request endpoint
req.setEndpoint(WAVE_QUERY);
req.setMethod('POST');
// set request headers
req.setHeader(HEADER_AUTHORIZATION, HEADER_AUTHORIZATION_PREFIX + ' ' + oAuthAccessToken);
req.setHeader(HEADER_CONTENT_TYPE, HEADER_CONTENT_TYPE_JSON);
// set request body
body = '{"query":"q = load "0FbB00000005ZQPKA2/0FcB00000006PlCKAU"; q = foreach q generate 'Prediction_Rate' as 'Prediction_Rate',
'Recommended_Product_Name' as 'Recommended_Product_Name', 'Related_Product_1_Name' as 'Related_Product_1_Name', 'Related_Product_2_Name' as 'Related_Product_2_Name'; q
= order q by 'Prediction_Rate' desc; q = limit q 100;"}';
req.setBody(body);
// send request
res = http.send(req);
// parse JSON response using JSON2ApexQueryResult2 class
queryResult = JSON2ApexQueryResponse2.parse(res.getBody());
List<JSON2ApexQueryResponse2.Records> records = queryResult1.Results.records;
for (JSON2ApexQueryResponse2.Records r : records) {
debugStr2 += 'Recommended = ' + r.Recommended_Product + '; Related 1 = ' + r.Related_Product1 + ', Related 2 = ' + r.Related_Product2 + 'n';
}
} catch(System.CalloutException ex) {
system.debug(LoggingLevel.INFO,'Callout error: '+ex);
system.debug(LoggingLevel.INFO,res.toString());
}
}
The	
  Code	
  
// set request body
body = '{"query":"q = load 
"0FbB00000005ZQPKA2/0FcB00000006PlCKAU"; q =
foreach q generate 'Prediction_Rate' as
'Prediction_Rate', 'Recommended_Product_Name' as
'Recommended_Product_Name', 'Related_Product_1_Name
' as 'Related_Product_1_Name',
'Related_Product_2_Name' as 'Related_Product_2_Name
'; q = order q by 'Prediction_Rate' desc; q = limit
q 100;"}';
The	
  Code	
  /**
* compute prediction score for a given product and account
* @param accountId the id of the account to get a prediction score for
* @param productId the id of the product to get a prediction score for
* @return the prediction score for the given account and product
*/
private Decimal computePredictionScore(ID productId, ID accountId) {
Decimal score = 0.00000;
Decimal sumOfSim = 0.00000;
Decimal sumOfRateSim = 0.00000;
// get product similarity map for the given product
Map<ID,Decimal> simMap = productSimMap.get(productId);
if (!productSimMap.containsKey(productId)) {
return score;
}
// iterate over products in product similarity map
for (ID prodIdKey : simMap.keySet()) {
// get the product similarity
Decimal productSim = simMap.get(prodIdKey);
// keep track of the sum of similarties
sumOfSim += Math.abs(productSim);
// keep track of the sum of zrate similarities
if (productZRateMap.containsKey(prodIdKey)) {
Map<ID,Decimal> productZRate = productZRateMap.get(prodIdKey);
if (productZRate.containsKey(accountId)) {
Decimal accountSim = productZRate.get(accountId);
sumOfRateSim += productSim * accountSim;
}
}
}
// calculate the prediction score
if (sumOfSim != 0.00000) {
// get product average and std deviation
Map<String,Decimal> productStats = productStatsMap.get(productId);
Decimal productAvg = productStats.get(KEY_AVG);
Decimal productStd = productStats.get(KEY_STD);
// calculate the score
score = productAvg + (productStd * (sumOfRateSim / sumOfSim));
}
// return the prediction score
return score;
}
Lessons	
  Learned	
  
•  Leveraging	
  Wave	
  
•  Use	
  Salesforce	
  to	
  Wave	
  data	
  flows	
  to	
  store	
  historical	
  data	
  and	
  trends	
  
•  Use	
  Wave	
  API	
  to	
  query	
  for	
  recommended	
  products	
  
•  Use	
  Wave	
  dashboards	
  for	
  visualiza7on	
  of	
  recommenda7ons	
  
•  Implemen7ng	
  Machine	
  Learning	
  on	
  Salesforce	
  
•  With	
  Apex-­‐	
  breakup	
  into	
  batch	
  process	
  to	
  stay	
  within	
  governor	
  limits	
  
•  With	
  Heroku	
  –	
  fewer	
  restric7ons	
  but	
  introduces	
  data	
  security	
  challenges	
  
•  Changes	
  to	
  the	
  model	
  once	
  coded	
  are	
  difficult	
  and	
  present	
  design	
  
considera7ons	
  for	
  produc7za7on	
  
Ques*ons?	
  
Thank	
  You	
  

Mais conteúdo relacionado

Mais procurados

Use Custom Metadata Types for Easy ALM & Compliance for Your Custom Apps
Use Custom Metadata Types for Easy ALM & Compliance for Your Custom AppsUse Custom Metadata Types for Easy ALM & Compliance for Your Custom Apps
Use Custom Metadata Types for Easy ALM & Compliance for Your Custom AppsSalesforce Developers
 
Analyze billions of records on Salesforce App Cloud with BigObject
Analyze billions of records on Salesforce App Cloud with BigObjectAnalyze billions of records on Salesforce App Cloud with BigObject
Analyze billions of records on Salesforce App Cloud with BigObjectSalesforce Developers
 
Salesforce1: Every Developer is a Mobile Developer
Salesforce1: Every Developer is a Mobile DeveloperSalesforce1: Every Developer is a Mobile Developer
Salesforce1: Every Developer is a Mobile DeveloperSalesforce Developers
 
Salesforce API Series: Fast Parallel Data Loading with the Bulk API Webinar
Salesforce API Series: Fast Parallel Data Loading with the Bulk API WebinarSalesforce API Series: Fast Parallel Data Loading with the Bulk API Webinar
Salesforce API Series: Fast Parallel Data Loading with the Bulk API WebinarSalesforce Developers
 
Performance Tuning for Visualforce and Apex
Performance Tuning for Visualforce and ApexPerformance Tuning for Visualforce and Apex
Performance Tuning for Visualforce and ApexSalesforce Developers
 
Solving Complex Data Load Challenges
Solving Complex Data Load ChallengesSolving Complex Data Load Challenges
Solving Complex Data Load ChallengesSunand P
 
Inside the Force.com Query Optimizer Webinar
Inside the Force.com Query Optimizer WebinarInside the Force.com Query Optimizer Webinar
Inside the Force.com Query Optimizer WebinarSalesforce Developers
 
Salesforce Multitenant Architecture: How We Do the Magic We Do
Salesforce Multitenant Architecture: How We Do the Magic We DoSalesforce Multitenant Architecture: How We Do the Magic We Do
Salesforce Multitenant Architecture: How We Do the Magic We DoSalesforce Developers
 
Using Oculus Rift and Virtual Reality to Visualize Data on Salesforce
Using Oculus Rift and Virtual Reality to Visualize Data on SalesforceUsing Oculus Rift and Virtual Reality to Visualize Data on Salesforce
Using Oculus Rift and Virtual Reality to Visualize Data on SalesforceSalesforce Developers
 
Lightning components performance best practices
Lightning components performance best practicesLightning components performance best practices
Lightning components performance best practicesSalesforce Developers
 
Secure Development on the Salesforce Platform - Part 2
Secure Development on the Salesforce Platform - Part 2Secure Development on the Salesforce Platform - Part 2
Secure Development on the Salesforce Platform - Part 2Salesforce Developers
 
Performance Tuning for Visualforce and Apex
Performance Tuning for Visualforce and ApexPerformance Tuning for Visualforce and Apex
Performance Tuning for Visualforce and ApexSalesforce Developers
 
Lighting up the Bay, Real-World App Cloud
Lighting up the Bay, Real-World App CloudLighting up the Bay, Real-World App Cloud
Lighting up the Bay, Real-World App CloudSalesforce Developers
 
SAP and Salesforce Integration
SAP and Salesforce IntegrationSAP and Salesforce Integration
SAP and Salesforce IntegrationGlenn Johnson
 
Bringing Your Back Office Data To Life with Salesforce Connect
Bringing Your Back Office Data To Life with Salesforce ConnectBringing Your Back Office Data To Life with Salesforce Connect
Bringing Your Back Office Data To Life with Salesforce ConnectEugenio Roldán Romasanta
 
Lightning connect sap_integration_df2015
Lightning connect sap_integration_df2015Lightning connect sap_integration_df2015
Lightning connect sap_integration_df2015Dreamforce
 
Introduction to External Objects and the OData Connector
Introduction to External Objects and the OData ConnectorIntroduction to External Objects and the OData Connector
Introduction to External Objects and the OData ConnectorSalesforce Developers
 
Summer '15 Release Preview: Platform Feature Highlights
Summer '15 Release Preview: Platform Feature Highlights Summer '15 Release Preview: Platform Feature Highlights
Summer '15 Release Preview: Platform Feature Highlights Salesforce Developers
 
Lightning Component - Components, Actions and Events
Lightning Component - Components, Actions and EventsLightning Component - Components, Actions and Events
Lightning Component - Components, Actions and EventsDurgesh Dhoot
 

Mais procurados (20)

Use Custom Metadata Types for Easy ALM & Compliance for Your Custom Apps
Use Custom Metadata Types for Easy ALM & Compliance for Your Custom AppsUse Custom Metadata Types for Easy ALM & Compliance for Your Custom Apps
Use Custom Metadata Types for Easy ALM & Compliance for Your Custom Apps
 
Analyze billions of records on Salesforce App Cloud with BigObject
Analyze billions of records on Salesforce App Cloud with BigObjectAnalyze billions of records on Salesforce App Cloud with BigObject
Analyze billions of records on Salesforce App Cloud with BigObject
 
Salesforce1: Every Developer is a Mobile Developer
Salesforce1: Every Developer is a Mobile DeveloperSalesforce1: Every Developer is a Mobile Developer
Salesforce1: Every Developer is a Mobile Developer
 
Salesforce API Series: Fast Parallel Data Loading with the Bulk API Webinar
Salesforce API Series: Fast Parallel Data Loading with the Bulk API WebinarSalesforce API Series: Fast Parallel Data Loading with the Bulk API Webinar
Salesforce API Series: Fast Parallel Data Loading with the Bulk API Webinar
 
Performance Tuning for Visualforce and Apex
Performance Tuning for Visualforce and ApexPerformance Tuning for Visualforce and Apex
Performance Tuning for Visualforce and Apex
 
Solving Complex Data Load Challenges
Solving Complex Data Load ChallengesSolving Complex Data Load Challenges
Solving Complex Data Load Challenges
 
Salesforce and sap integration
Salesforce and sap integrationSalesforce and sap integration
Salesforce and sap integration
 
Inside the Force.com Query Optimizer Webinar
Inside the Force.com Query Optimizer WebinarInside the Force.com Query Optimizer Webinar
Inside the Force.com Query Optimizer Webinar
 
Salesforce Multitenant Architecture: How We Do the Magic We Do
Salesforce Multitenant Architecture: How We Do the Magic We DoSalesforce Multitenant Architecture: How We Do the Magic We Do
Salesforce Multitenant Architecture: How We Do the Magic We Do
 
Using Oculus Rift and Virtual Reality to Visualize Data on Salesforce
Using Oculus Rift and Virtual Reality to Visualize Data on SalesforceUsing Oculus Rift and Virtual Reality to Visualize Data on Salesforce
Using Oculus Rift and Virtual Reality to Visualize Data on Salesforce
 
Lightning components performance best practices
Lightning components performance best practicesLightning components performance best practices
Lightning components performance best practices
 
Secure Development on the Salesforce Platform - Part 2
Secure Development on the Salesforce Platform - Part 2Secure Development on the Salesforce Platform - Part 2
Secure Development on the Salesforce Platform - Part 2
 
Performance Tuning for Visualforce and Apex
Performance Tuning for Visualforce and ApexPerformance Tuning for Visualforce and Apex
Performance Tuning for Visualforce and Apex
 
Lighting up the Bay, Real-World App Cloud
Lighting up the Bay, Real-World App CloudLighting up the Bay, Real-World App Cloud
Lighting up the Bay, Real-World App Cloud
 
SAP and Salesforce Integration
SAP and Salesforce IntegrationSAP and Salesforce Integration
SAP and Salesforce Integration
 
Bringing Your Back Office Data To Life with Salesforce Connect
Bringing Your Back Office Data To Life with Salesforce ConnectBringing Your Back Office Data To Life with Salesforce Connect
Bringing Your Back Office Data To Life with Salesforce Connect
 
Lightning connect sap_integration_df2015
Lightning connect sap_integration_df2015Lightning connect sap_integration_df2015
Lightning connect sap_integration_df2015
 
Introduction to External Objects and the OData Connector
Introduction to External Objects and the OData ConnectorIntroduction to External Objects and the OData Connector
Introduction to External Objects and the OData Connector
 
Summer '15 Release Preview: Platform Feature Highlights
Summer '15 Release Preview: Platform Feature Highlights Summer '15 Release Preview: Platform Feature Highlights
Summer '15 Release Preview: Platform Feature Highlights
 
Lightning Component - Components, Actions and Events
Lightning Component - Components, Actions and EventsLightning Component - Components, Actions and Events
Lightning Component - Components, Actions and Events
 

Semelhante a Wave Analytics: Developing Predictive Business Intelligence Apps

PredictionIO – A Machine Learning Server in Scala – SF Scala
PredictionIO – A Machine Learning Server in Scala – SF ScalaPredictionIO – A Machine Learning Server in Scala – SF Scala
PredictionIO – A Machine Learning Server in Scala – SF Scalapredictionio
 
[WSO2Con Asia 2018] Patterns for Building Streaming Apps
[WSO2Con Asia 2018] Patterns for Building Streaming Apps[WSO2Con Asia 2018] Patterns for Building Streaming Apps
[WSO2Con Asia 2018] Patterns for Building Streaming AppsWSO2
 
CodingSerbia2014-JavaVSPig
CodingSerbia2014-JavaVSPigCodingSerbia2014-JavaVSPig
CodingSerbia2014-JavaVSPigDusan Zamurovic
 
Grokking Engineering - Data Analytics Infrastructure at Viki - Huy Nguyen
Grokking Engineering - Data Analytics Infrastructure at Viki - Huy NguyenGrokking Engineering - Data Analytics Infrastructure at Viki - Huy Nguyen
Grokking Engineering - Data Analytics Infrastructure at Viki - Huy NguyenHuy Nguyen
 
CiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklum Ukraine
 
Introduction to PredictionIO
Introduction to PredictionIOIntroduction to PredictionIO
Introduction to PredictionIOMuhammet Arslan
 
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Roel Hartman
 
Agile data presentation 3 - cambridge
Agile data   presentation 3 - cambridgeAgile data   presentation 3 - cambridge
Agile data presentation 3 - cambridgeRomans Malinovskis
 
Elixir, GraphQL and Vue.js
Elixir, GraphQL and Vue.jsElixir, GraphQL and Vue.js
Elixir, GraphQL and Vue.jsJeroen Visser
 
AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...
AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...
AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...Amazon Web Services
 
Introducing Amazon Machine Learning
Introducing Amazon Machine LearningIntroducing Amazon Machine Learning
Introducing Amazon Machine LearningAmazon Web Services
 
Prateek dayal backbonerails-110528024926-phpapp02
Prateek dayal backbonerails-110528024926-phpapp02Prateek dayal backbonerails-110528024926-phpapp02
Prateek dayal backbonerails-110528024926-phpapp02Revath S Kumar
 
Single Page Web Apps with Backbone.js and Rails
Single Page Web Apps with Backbone.js and RailsSingle Page Web Apps with Backbone.js and Rails
Single Page Web Apps with Backbone.js and RailsPrateek Dayal
 
Week 8
Week 8Week 8
Week 8A VD
 
Wix Machine Learning - Ran Romano
Wix Machine Learning - Ran RomanoWix Machine Learning - Ran Romano
Wix Machine Learning - Ran RomanoWix Engineering
 
How We Built the Private AppExchange App (Apex, Visualforce, RWD)
How We Built the Private AppExchange App (Apex, Visualforce, RWD)How We Built the Private AppExchange App (Apex, Visualforce, RWD)
How We Built the Private AppExchange App (Apex, Visualforce, RWD)Salesforce Developers
 

Semelhante a Wave Analytics: Developing Predictive Business Intelligence Apps (20)

PredictionIO – A Machine Learning Server in Scala – SF Scala
PredictionIO – A Machine Learning Server in Scala – SF ScalaPredictionIO – A Machine Learning Server in Scala – SF Scala
PredictionIO – A Machine Learning Server in Scala – SF Scala
 
[WSO2Con Asia 2018] Patterns for Building Streaming Apps
[WSO2Con Asia 2018] Patterns for Building Streaming Apps[WSO2Con Asia 2018] Patterns for Building Streaming Apps
[WSO2Con Asia 2018] Patterns for Building Streaming Apps
 
Node.js and Parse
Node.js and ParseNode.js and Parse
Node.js and Parse
 
Apigee Demo: API Platform Overview
Apigee Demo: API Platform OverviewApigee Demo: API Platform Overview
Apigee Demo: API Platform Overview
 
CodingSerbia2014-JavaVSPig
CodingSerbia2014-JavaVSPigCodingSerbia2014-JavaVSPig
CodingSerbia2014-JavaVSPig
 
Grokking Engineering - Data Analytics Infrastructure at Viki - Huy Nguyen
Grokking Engineering - Data Analytics Infrastructure at Viki - Huy NguyenGrokking Engineering - Data Analytics Infrastructure at Viki - Huy Nguyen
Grokking Engineering - Data Analytics Infrastructure at Viki - Huy Nguyen
 
CiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForce
 
Introduction to PredictionIO
Introduction to PredictionIOIntroduction to PredictionIO
Introduction to PredictionIO
 
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
 
Agile data presentation 3 - cambridge
Agile data   presentation 3 - cambridgeAgile data   presentation 3 - cambridge
Agile data presentation 3 - cambridge
 
Elixir, GraphQL and Vue.js
Elixir, GraphQL and Vue.jsElixir, GraphQL and Vue.js
Elixir, GraphQL and Vue.js
 
Patterns for Building Streaming Apps
Patterns for Building Streaming AppsPatterns for Building Streaming Apps
Patterns for Building Streaming Apps
 
AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...
AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...
AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...
 
Building Streaming Applications with Streaming SQL
Building Streaming Applications with Streaming SQLBuilding Streaming Applications with Streaming SQL
Building Streaming Applications with Streaming SQL
 
Introducing Amazon Machine Learning
Introducing Amazon Machine LearningIntroducing Amazon Machine Learning
Introducing Amazon Machine Learning
 
Prateek dayal backbonerails-110528024926-phpapp02
Prateek dayal backbonerails-110528024926-phpapp02Prateek dayal backbonerails-110528024926-phpapp02
Prateek dayal backbonerails-110528024926-phpapp02
 
Single Page Web Apps with Backbone.js and Rails
Single Page Web Apps with Backbone.js and RailsSingle Page Web Apps with Backbone.js and Rails
Single Page Web Apps with Backbone.js and Rails
 
Week 8
Week 8Week 8
Week 8
 
Wix Machine Learning - Ran Romano
Wix Machine Learning - Ran RomanoWix Machine Learning - Ran Romano
Wix Machine Learning - Ran Romano
 
How We Built the Private AppExchange App (Apex, Visualforce, RWD)
How We Built the Private AppExchange App (Apex, Visualforce, RWD)How We Built the Private AppExchange App (Apex, Visualforce, RWD)
How We Built the Private AppExchange App (Apex, Visualforce, RWD)
 

Mais de Salesforce Developers

Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce DevelopersSample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce DevelopersSalesforce Developers
 
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceMaximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceSalesforce Developers
 
Local development with Open Source Base Components
Local development with Open Source Base ComponentsLocal development with Open Source Base Components
Local development with Open Source Base ComponentsSalesforce Developers
 
TrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsTrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsSalesforce Developers
 
Why developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX IndiaWhy developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX IndiaSalesforce Developers
 
CodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentCodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentSalesforce Developers
 
CodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web ComponentsCodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web ComponentsSalesforce Developers
 
Enterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web ComponentsEnterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web ComponentsSalesforce Developers
 
TrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsTrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsSalesforce Developers
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and TestingSalesforce Developers
 
LWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilityLWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilitySalesforce Developers
 
Lightning web components episode 2- work with salesforce data
Lightning web components   episode 2- work with salesforce dataLightning web components   episode 2- work with salesforce data
Lightning web components episode 2- work with salesforce dataSalesforce Developers
 
Lightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionSalesforce Developers
 
Migrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCPMigrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCPSalesforce Developers
 
Scale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceScale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceSalesforce Developers
 
Replicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureReplicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureSalesforce Developers
 
Modern Development with Salesforce DX
Modern Development with Salesforce DXModern Development with Salesforce DX
Modern Development with Salesforce DXSalesforce Developers
 
Integrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS ConnectIntegrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS ConnectSalesforce Developers
 

Mais de Salesforce Developers (20)

Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce DevelopersSample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce Developers
 
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceMaximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component Performance
 
Local development with Open Source Base Components
Local development with Open Source Base ComponentsLocal development with Open Source Base Components
Local development with Open Source Base Components
 
TrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsTrailheaDX India : Developer Highlights
TrailheaDX India : Developer Highlights
 
Why developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX IndiaWhy developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX India
 
CodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentCodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local Development
 
CodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web ComponentsCodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web Components
 
Enterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web ComponentsEnterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web Components
 
TrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsTrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer Highlights
 
Live coding with LWC
Live coding with LWCLive coding with LWC
Live coding with LWC
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and Testing
 
LWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilityLWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura Interoperability
 
Lightning web components episode 2- work with salesforce data
Lightning web components   episode 2- work with salesforce dataLightning web components   episode 2- work with salesforce data
Lightning web components episode 2- work with salesforce data
 
Lightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An Introduction
 
Migrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCPMigrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCP
 
Scale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceScale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in Salesforce
 
Replicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureReplicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data Capture
 
Modern Development with Salesforce DX
Modern Development with Salesforce DXModern Development with Salesforce DX
Modern Development with Salesforce DX
 
Get Into Lightning Flow Development
Get Into Lightning Flow DevelopmentGet Into Lightning Flow Development
Get Into Lightning Flow Development
 
Integrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS ConnectIntegrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS Connect
 

Último

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 

Último (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

Wave Analytics: Developing Predictive Business Intelligence Apps

  • 1. Wave  Analy*cs:     Developing  Predic*ve  Business  Intelligence  Apps  
  • 2. Built  on  the  Salesforce1™  Pla?orm   Quote   Contract   Revenue  Opportunity   ERP   CONTRACT   LIFECYCLE   MANAGEMENT   ORDER   MANAGEMENT  CONFIGURE   PRICE   QUOTE   BILLING   REBATE   MANAGEMENT   DEAL  MANAGEMENT   E-­‐COMMERCE   QUOTE-­‐TO-­‐CASH  INTELLIGENCE        X-­‐AUTHOR   ApQus  Quote-­‐to-­‐Cash  Footprint  
  • 3. Why  Predic*ve  is  Important…   • IoT  and  the  Age  of  Data   • New  Tools  are  needed     •  Descrip7ve   •  Predic7ve   •  Prescrip7ve  Analy7cs   • Ac7on  from  Insight  
  • 4. The  Ways  Wave  helps…   • Visualizing  descrip7ve  and  predic7ve  analysis   • Delivering  insights  to  Salesforce  users  
  • 5. If  you  have  one  of  these…..         Then  you  might  like  these…  
  • 6. Story:  Growing  Revenue  and  Margin     •  Business  wants  to  grow  revenue  with  cross-­‐sell  and  up-­‐sell   recommenda7ons  based  on  data  analysis   •  Marke7ng  uses  Wave  to  es7mate  the  poten7al  opportunity   •  Sales  rep  receives  a  recommenda7on  for  her  customer  from  ApHus  that  will   increase  the  size  of  the  deal   •  Wave  provides  the  Sales  rep  with  addi7onal  insight  into  the   recommenda7on  for  the  customer  which  helps  her  be  more  consulta7ve   •  Marke7ng  uses  Wave  to  track  the  business  impact  of  the    recommenda7ons   which  convert  into  sales    
  • 8. Add  Products  to  Cart   Browse  Recommended   Products   Adds  Recommended   Products  to  Cart   Analyze  Purchase   History  of  Similar   Customers       Predict  Recommended   Products   ApQus  Use  Case   Display  chart  depic7ng   Recommended  Products  by   Customer  cluster   Display  chart  depic7ng    $   from  Recommenda7ons   added  to  cart   Salesforce   Database   Frequency   Similarity   Predic7on   Marke7ng   Sales   Wave   Database   Explain  Product   Recommenda7ons   Wave  API   Recommender  API   ApHus  CPQ   ApHus  Cross-­‐Sell     Recommender   Wave  
  • 9. Machine-­‐Learning  Algorithm   Algorithm –  ML uses statistics to analyze and predict patterns in data –  Item-based Collaborative Filtering –  Initial model developed in “R” uses KNN (K Nearest Neighbor) –  3 main components of the algorithm ▪  Frequency ▪  Similarity ▪  Prediction –  Capable of unsupervised learning Frequency Table –  Count number of Products (items) purchased by each Account
  • 10. Compute              
  • 11. Recommenda*on   •  Select products (items) which are similar to the product added to the Cart •  Given an account, choose top-N products among the similar products based on the estimated rates •  Products 15 & 20 are recommended to the user Added Product 1 to the Cart Similar Products Product 3 Product 8 Product 10 Product 15 Product 20 User Prediction Rate 0.5 1 0.3 2 3 User
  • 12. The  Code   public void callWaveAPI() { Http http = new Http(); HttpRequest req = new HttpRequest(); HttpResponse res = new HttpResponse(); // Wave REST API calls String WAVE_BASE = 'https://gs0.salesforce.com/services/data/v34.0/wave'; String WAVE_DATASETS = WAVE_BASE + '/datasets'; String WAVE_QUERY = WAVE_BASE + '/query'; try { // send Wave API request to query dataset req = new HttpRequest(); // set request endpoint req.setEndpoint(WAVE_QUERY); req.setMethod('POST'); // set request headers req.setHeader(HEADER_AUTHORIZATION, HEADER_AUTHORIZATION_PREFIX + ' ' + oAuthAccessToken); req.setHeader(HEADER_CONTENT_TYPE, HEADER_CONTENT_TYPE_JSON); // set request body body = '{"query":"q = load "0FbB00000005ZQPKA2/0FcB00000006PlCKAU"; q = foreach q generate 'Prediction_Rate' as 'Prediction_Rate', 'Recommended_Product_Name' as 'Recommended_Product_Name', 'Related_Product_1_Name' as 'Related_Product_1_Name', 'Related_Product_2_Name' as 'Related_Product_2_Name'; q = order q by 'Prediction_Rate' desc; q = limit q 100;"}'; req.setBody(body); // send request res = http.send(req); // parse JSON response using JSON2ApexQueryResult2 class queryResult = JSON2ApexQueryResponse2.parse(res.getBody()); List<JSON2ApexQueryResponse2.Records> records = queryResult1.Results.records; for (JSON2ApexQueryResponse2.Records r : records) { debugStr2 += 'Recommended = ' + r.Recommended_Product + '; Related 1 = ' + r.Related_Product1 + ', Related 2 = ' + r.Related_Product2 + 'n'; } } catch(System.CalloutException ex) { system.debug(LoggingLevel.INFO,'Callout error: '+ex); system.debug(LoggingLevel.INFO,res.toString()); } }
  • 13. The  Code   // set request body body = '{"query":"q = load "0FbB00000005ZQPKA2/0FcB00000006PlCKAU"; q = foreach q generate 'Prediction_Rate' as 'Prediction_Rate', 'Recommended_Product_Name' as 'Recommended_Product_Name', 'Related_Product_1_Name ' as 'Related_Product_1_Name', 'Related_Product_2_Name' as 'Related_Product_2_Name '; q = order q by 'Prediction_Rate' desc; q = limit q 100;"}';
  • 14. The  Code  /** * compute prediction score for a given product and account * @param accountId the id of the account to get a prediction score for * @param productId the id of the product to get a prediction score for * @return the prediction score for the given account and product */ private Decimal computePredictionScore(ID productId, ID accountId) { Decimal score = 0.00000; Decimal sumOfSim = 0.00000; Decimal sumOfRateSim = 0.00000; // get product similarity map for the given product Map<ID,Decimal> simMap = productSimMap.get(productId); if (!productSimMap.containsKey(productId)) { return score; } // iterate over products in product similarity map for (ID prodIdKey : simMap.keySet()) { // get the product similarity Decimal productSim = simMap.get(prodIdKey); // keep track of the sum of similarties sumOfSim += Math.abs(productSim); // keep track of the sum of zrate similarities if (productZRateMap.containsKey(prodIdKey)) { Map<ID,Decimal> productZRate = productZRateMap.get(prodIdKey); if (productZRate.containsKey(accountId)) { Decimal accountSim = productZRate.get(accountId); sumOfRateSim += productSim * accountSim; } } } // calculate the prediction score if (sumOfSim != 0.00000) { // get product average and std deviation Map<String,Decimal> productStats = productStatsMap.get(productId); Decimal productAvg = productStats.get(KEY_AVG); Decimal productStd = productStats.get(KEY_STD); // calculate the score score = productAvg + (productStd * (sumOfRateSim / sumOfSim)); } // return the prediction score return score; }
  • 15. Lessons  Learned   •  Leveraging  Wave   •  Use  Salesforce  to  Wave  data  flows  to  store  historical  data  and  trends   •  Use  Wave  API  to  query  for  recommended  products   •  Use  Wave  dashboards  for  visualiza7on  of  recommenda7ons   •  Implemen7ng  Machine  Learning  on  Salesforce   •  With  Apex-­‐  breakup  into  batch  process  to  stay  within  governor  limits   •  With  Heroku  –  fewer  restric7ons  but  introduces  data  security  challenges   •  Changes  to  the  model  once  coded  are  difficult  and  present  design   considera7ons  for  produc7za7on