BookmarkSubscribeRSS Feed

Real-Time Customer Recommendation Systems For Data-In-Motion

Started a month ago by
Modified 3 weeks ago by
Views 534

Helping customers of your brand's owned digital properties find items of interest is useful in almost any situation. In part one and part two of this Customer Recommendation Systems article series, we completed:


  • An introductory tour of Do-It-For-Me (DIFM) and Do-It-Yourself (DIY) recommendation analysis use cases applied in martech leveraging SAS Customer Intelligence 360 and SAS Visual Data Mining and Machine Learning on SAS Viya
  • A walkthrough of how champion-challenger DIY recommendation analysis elevates support of personalized marketing
  • An explanation of the details behind the DIY analytical techniques (algorithms) generally available in SAS that can be applied to customer and product recommendations
  • A transparent demonstration video of how SAS users can perform DIY recommendation model training and scoring for data-at-rest and customer experience orchestration

In part three of this article series, we will:


  • Evolve from offline training & scoring into online training & scoring for real-time use cases leveraging streaming data-in-motion 
  • Showcase how SAS Customer Intelligence 360 and streaming analytics work together

Image 1: Streaming Recommender AnalyticsImage 1: Streaming Recommender Analytics


Gone are the days when a data scientist was solely responsible for analytics. Now, everyone within a brand needs to make decisions based on data. At SAS, we are on a mission to enable and empower everyone – from executives to IT to marketing specialists, all to contribute and build a true customer analytics culture. In the context of real-time recommendation systems, SAS is delivering ready-made solutions to help brands get incremental value in areas like Customer Intelligence, Fraud, Risk, and others. 


If brands can make every single decision better using data, this creates a competitive advantage that will be unmatched. SAS allows users to innovate everywhere by enabling analytics across all analytical environments and paradigms. Imagine this: no matter how or where you want your analytics – on-premise, cloud, hybrid, through APIs – or where you need it – stream, database, server, edge – analytics everywhere means bringing analytics to wherever there is data. Why is this important and relevant?


1st party customer data has value in various stages. Some is only valuable right when it originates, other data gains value when combined with other data. For example, a superior customer experience requires the ability to analyze relevant data, score and activate 1:1 recommendations when the prospect is directly interacting with the brand. Customer moments matter!


SAS knows that technology needs to work together. Which is how we pioneered the SAS Analytics Life Cycle and continue to perfect the process of extracting intelligence and value from data. Through integrating SAS, open source, and other vendors directly into the life cycle, the intention is to help brands become more powerful and governed, ultimately building trust and inspiring collaboration that leads to innovation. 


Image 2: Strategic Focus of SAS Customer Intelligence 360 with AIoTImage 2: Strategic Focus of SAS Customer Intelligence 360 with AIoT


Now, recommendation analysis leverages customer interaction data to uncover hidden patterns in order to identify related products, services or content to surface for targeting and personalization. This analysis easily extends to other types of use cases to build more customer relevance, especially with recent innovations of new AI/ML techniques. 


If you’ve ever used Amazon, Netflix, or YouTube, you’ve experienced the value of recommendation systems firsthand. These sophisticated systems identify recommendations autonomously for individual users based on past purchases and searches, as well as other behaviors. Customers get algorithmic recommendations on additional offerings that are intended to be relevant, valued, and helpful. Consumers can use recommendations to:


  • Find things that are interesting or useful.
  • Narrow a set of choices.
  • Explore options.
  • Discover new things.


Marketers can enhance offers that proactively build better customer relationships, retention and sales. For example, brands typically realize:


  • Stronger customer relationships by providing personalization.
  • Higher engagement, click-through and conversion rates.
  • New opportunities for promotion, persuasion, and profitability.
  • Deeper knowledge about customers.


 Image 3: Recommendation system use cases in martechImage 3: Recommendation system use cases in martech


Across the user spectrum, SAS enables DataOps, ModelOps & Customer Experiences. Think of it like this:


SAS is the “always on” universal inferencing engine, in the cloud and at the edge, being the real-time, operationalization platform for recommender models produced by a brand.

What exactly does this mean in the context of streaming recommendation systems?


  • Processing data continuously, on the move, in-memory with very high speed and low latency
  • Flexible Publish and Subscribe framework
  • Performing actions such as filtering, aggregation, pattern detection, correlations, machine learning, geofencing, image processing, etc.
  • Adding historical context or enrichment data to what is being observed of customer behavior in real time
  • Scoring events using trained analytical models from SAS or externally from open-source (Python, R)
  • Design and test projects in the low code, graphical design environment (or high-code if the user prefers)
  • Orchestrate, deploy and monitor
  • Track and update when new recommender champion models are promoted

Image 4: SAS for Real Time Customer Recommendation Systems (Detailed View)Image 4: SAS for Real Time Customer Recommendation Systems (Detailed View)


In SAS Customer Intelligence 360, events enable users to enhance their ability to understand, target, and interact with customers in a meaningful way. Events are used to track user behavior and to provide input conditions for other items such as spots, segments, tasks, data views, and activities. For example, events are used in some of these ways:


  • Record when customers view a web page or in a mobile app
  • Observe implicit or explicit customer behaviors
  • Trigger a recommendation system to act


Tracking user interactions is one of the core features that enables your digital properties to respond in real time to customers based on their profile, origin, browsing behavior, and so on. When a visitor interacts with your website (for example, through a click event), that event is processed by the run-time environment and can be used to control many website features. 


Image 5: Actionable Event Tracking & Recommendation System TriggeringImage 5: Actionable Event Tracking & Recommendation System Triggering


Tasks coordinate the items/offers/calls-to-action that SAS Customer Intelligence 360 uses to deliver content to a target audience. As a task runs, it collects data that can be used to monitor performance or be used to refine how the task delivers content. Building upon this concept, an activity (or customer journey) is a coordinated series of tasks that are designed to meet the goals of a marketing campaign, such as one that is supported by a recommendation system.


An activity uses tasks and events. It charts the customer paths between tasks, such as recommending a particular message through a specific channel, and conditions, like the primary metric and evaluation periods. For example, users might leverage a mobile task to present a product offer on your brand's app. Then, users could select an email task to send a discount offer to all customers who interacted with the mobile recommendation within the last week (but haven't converted yet).


Image 6: Recommender Activity MapImage 6: Recommender Activity Map


In SAS Customer Intelligence 360, users can create tasks (Web, Mobile, etc.) that display different creatives based either on a product being viewed or a customer’s behavior. There are two methods for delivering recommendations to users. User-centric recommendations take a user’s behavior into account. Product-centric recommendations are based solely on a product.


Martech industry solutions frequently offer "easy-button" or automated analytical solutions that over-promise the potential of machine learning and AI. In the end, for readers who have used DIFM (Do-It-For-Me) features, they automate analytical model templates with limited abilities to accommodate customization. Our viewpoint at SAS is the availability of DIFM features in software is important, especially in the absence of any analytical enhancements to a brand's present-day use cases. However, the desire to incrementally improve on DIFM technology features allows us to pivot to DIY (Do-It-Yourself) approaches in recommendation analysis.


A sampling of native recommendation analysis algorithms available in SAS include regularized & non-negative matrix factorization, k-nearest neighbor, bayesian personalized ranking, factorization machines, data translation w/ optimal step-size, slope one, market basket, link analysis, and the list goes on. Additionally, SAS supports usage of open source (Python/R) recommender packages. Given the high volume of algorithms to select from as an analyst, SAS enables champion-challenger recommender modeling prior to deployment.


Recommendation Algorithm Candidates To Improve Offer Performance


Let's highlight three algorithmic approaches leveraging factorization machines (FMs), bayesian personalized ranking (BPR) & data translation w/ optimal step-size (DTOS). Given we have covered FMs in an earlier article, let's briefly describe the others:


Bayesian Personalized Ranking (BPR)


BPR as an algorithm can be applied to creating personalized recommendations of items for users on the basis of the users’ implicit feedback (such as web/mobile clicks or purchase history). BPR is a common method that is designed specifically to optimize recommendation ranking and has shown superior performance compared to other standard analysis techniques that are widely used to analyze explicit feedback. In the scenario of implicit feedback, an observation or event from an instrumented website or mobile app using SAS Customer Intelligence 360 captures the required input data which simply consists of a user (or customer) and an item (or product/service).


Among the available recommendation methods, collaborative filtering, matrix factorization and factorization machines  have shown to be effective approaches, and many researchers and brands have focused on these methods. For example, a factorization machine model is a general factorization model that considers both latent and auxiliary features, and it includes and mimics many basic collaborative filtering methods under various scenarios. Although factorization machines have shown good performance in both model prediction and computational complexity, the majority of factorization machine methods are designed for data that contains explicit feedback, whereas only a limited number of approaches have been proposed for data that contains implicit feedback. An alternative is to model the likelihood of ranking between items to utilize a new optimization criterion, Bayesian personalized ranking (BPR), for analyzing implicit feedback with item features which can have a significant influence on model performance. 


Data Translation With Optimal Step Size (DTOS)


From the perspective of customers, a recommender provides personalized recommendation by helping users to find interesting items (products, movies, music, etc). From the perspective of products, a recommender performs targeted advertising by identifying potential users that would be interested in a particular item. The information about users, items, and user-item interactions constitute the data that are used to achieve the goal of recommenders. Among the three types of information, user-item interactions are essential. Recommenders employing user-item interactions alone, without requiring the information of users or items, is based on collaborative filtering.  Typically, each user rates only a fraction of items and each item receive ratings from only a fraction of users, making an incomplete data matrix with only a fraction of entries observed. In this matrix formulation, the goal of recommenders, specifically collaborative filtering, becomes predicting the missing entries so as to locate the interesting items or potential users. A major bottleneck  is the reliance on singular value decomposition (SVD), limiting its use in large-scale applications.


An alternative approach to collaborative filtering is matrix factorization (MF), which models the user-item interactions as a product of two factor matrices. Each user or item is represented by a vector, and a rating entry is represented by the inner product of two vectors. These vectors can be considered as a feature representation of the users and items. As they are not observed, but rather are inferred from user-item interactions, these vectors are commonly referred to as latent features or factors. Moreover, the latent features of all users and all items may be inferred simultaneously, making it possible to incorporate the benefit of multitask learning (MTL). By the principle of MTL, the feature vector of each user is not only influenced by its own rating history, but also by the rating histories of other users, with the extent of influence dictated by the similarity between users. For this reason, a user may discover new interesting items from the rating histories of its peers who share similar interests, with the similarity identified from all users’ rating histories.


A widely adopted algorithm for learning MF models is Alternating Least Squares (ALS), which updates the two factor matrices alternately, keeping one fixed while updating the other. Given one matrix, ALS optimizes the other by solving a least squares (LS) problem for each user or item. As the LS solution is optimal, ALS can improve the learning objective aggressively in each iteration, leading to convergence in a small number of iterations. However, different users may have rated different items and, similarly, different items may have been rated by different users; thus, this leads to high computational cost in each iteration of ALS.


This issue can addressed with a softImpute-ALS algorithm, but sub-optimal results in applying this method has led SAS to introduce a new algorithm, termed Data Translation with Optimal Step-size (DTOS), to alleviate these drawbacks. As the name indicates, DTOS first performs data augmentation (or translation), an equivalent to the imputation step of softImpute-ALS. However, DTOS goes one step further to construct a set of solutions, with the softImpute-ALS solution included in the set as special element. The solutions are parameterized by a scalar that plays the role of step-size in gradient descent. The step-size is optimized by DTOS to find the solution that maximizes the original objective. The optimization guarantees a larger improvement of the original objective compared to the improvement achieved by softImpute-ALS, with this helping to alleviate the issue of slow progress per iteration and thus to speed up convergence. Thanks to the quadratic objective, the optimal step-size can be obtained in closed-form and its calculation does not introduce significant additional cost of computation; thus, DTOS has almost the same per-iteration computational complexity as softImpute-ALS. With the low cost per iteration and more aggressive improvement of the learning objective, DTOS blends the advantage of softImpute-ALS into that of ALS, and is expected to achieve a high performance-to-cost ratio.


In other words, DTOS is a fast algorithm for training recommender systems on implicit feedback. Users can leverage the DTOS action in SAS as a distributed, multithreaded implementation. The recommender model that the DTOS algorithm trains is represented by matrix factorization with partially defined factors (MF-PDF), a model that generalizes matrix factorization (MF) to include predefined factors (PDF) of users and/or items.


Image 6: SAS for Champion-Challenger Recommender ModelingImage 6: SAS for Champion-Challenger Recommender Modeling


Demystifying Champion-Challenger Do-It-Yourself (DIY) Recommendation Analysis For Martech


In general, it is a good practice to develop multiple AI models that support the same task. The reason for this is simple: if one model fails or the performance of that model degrades over time, there is always another model that can take over. For those unfamiliar with this approach, the champion model is the best model that is chosen from a pool of candidate models. In the machine learning ecosystem, this approach is often referred to as the champion-challenger approach, where the champion model is the model that currently has the best performance for the AI task at hand. Before users identify the champion model, they can evaluate the structure, performance, and resilience of candidate models. Users leverage challenger models to test the strength of champion models. 


The champion model is the model that typically runs in production and is continuously challenged by the challenger models. As soon as the champion model fails or one of the challenger models defeats the champion model, the current champion model can be quickly replaced, and the continuity of the AI system can be guaranteed.


Image 7: Event Stream Processing EngineImage 7: Event Stream Processing Engine


What does the difference between various types of recommender algorithms look like when it comes to metrics? There are several metrics to evaluate the performance of models in a champion-challenger context. In a forthcoming demo video available below, we will use the following metrics to make comparisons:


  • Area Under The Curve (AUC): AUC measures the likelihood that a random relevant item is ranked higher than a random irrelevant item. Higher the likelihood of this happening implies a higher AUC score meaning a better recommendation system. 
  • Hit Rate (HR): The hit ratio is simply the fraction of users for which the correct answer is included in the generated recommendation list (top 10 for example) extracted from all users in the test (or validation) modeling data.
  • Mean Reciprocal Rank (MRR): MRR calculates an average of reciprocal of ranks given to the relevant items. So if the relevant items are ranked higher, the reciprocal of the ranks would be lower leading to a lower metric score, as desired. Essentially, the idea behind evaluating a recommendation system is to make use of ranks given to the relevant items and translate into a single number indicating how good or bad the ranks are.


Image 78 Champion-Challenger Recommender Modeling Assessment ReportImage 78 Champion-Challenger Recommender Modeling Assessment Report


Please keep in mind, comparing the performance of recommendation models is not limited to these three metrics only.


Recommendation System Scenarios


Let's articulate two scenarios for designing and deploying a recommendation system:


Offline Training & Online Scoring


Offline training is performed on a snapshot of data at rest to produce scoring code. That scoring code can then be deployed into an online scoring system on forthcoming (new) streaming data produced by customers and prospects interacting with your brand. Keep in mind, the scoring on new data is based on a modeling solution that was trained offline (or in batch). Thus, the solution would need to be retrained at signs of performance decay. For a detailed demo video on this scenario (within the context of financial services), please check out this article. For SAS user documentation on developing offline recommenders, go here.


Image 9: Offline Training & Online ScoringImage 9: Offline Training & Online Scoring


Online Training & Scoring


The demonstration video below (in the context of the retail industry) is based on a true online training and scoring solution for recommendation systems.  The incremental value proposition here is represented by a recommender modeling solution that trained once on a snapshot of data-at-rest in SAS (to mitigate issues like cold start problems), deploy, and now online training and scoring handles the re-training of the model and associated scoring on a 1:1 basis. For SAS user documentation on developing online recommenders, go here.


Image 10: Online Training & ScoringImage 10: Online Training & Scoring


Real-Time Customer Recommendation Systems For Data-In-Motion (Demo Video)


Using a SAS for Retail website, let's walkthrough a technology demonstration where SAS Customer Intelligence 360 is leveraged for an AIoT use case in the context of recommenders.


Readers can scroll or swipe up to revisit Image 6 and the customer journey activity map that will entail the following:


  • The capture, contextualization and input streaming of digital interactions between a prospective customer and the brand's digital property
  • The event monitoring and triggering of a champion recommender model


Image 11: Demo Flow - Part 1Image 11: Demo Flow - Part 1


  • Training and scoring on data-in-motion
  • The output of the recommender scoring will drive immediate actioning, targeting and personalization back into the customer's digital experience

Image 12: Demo Flow - Part 2Image 12: Demo Flow - Part 2


Now that we have summarized the demo flow, view the presentation/demo video below for a summary of this use case, as well as live technology at work.



When we consider a customer experience with a brand, moments matter. Consumer are empowered by their digital devices, and can shift their attention from one brand to the next in a matter of seconds. The use cases for recommendation systems are expanding every day, across the entire martech industry. We look forward to what the future brings in our development process – as we enable technology users to access all of the most recent SAS analytical developments. In the near future, watch for SAS to release:


  • Deep learning based recommenders (multi-headed attention)
  • Reinforcement learning based recommenders
  • Graph convolution based recommenders 


Learn more about how SAS can be applied for customer analytics, journey personalization and integrated marketing here.



Version history
Last update:
3 weeks ago
Updated by:



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags