Designing an objective function for personalization in pharmaceutical marketing

Designing an objective function for personalization in pharmaceutical marketing

Aug 02, 2022 • 7 min read

This is the third article in our series introducing NBA to the commercial pharma industry. This article will explain how the customer engagement index (CEI) is calculated to enable NBA to recommend channels to sales reps based on historical health care provider (HCP) data and behavioral preferences. Please read the NBA introduction blog to gain a perspective and context on the solution we are discussing here.

In an omnichannel commercial pharma environment, where there are various channels of communication, including corporate emails, approved emails, phone calls, face-to-face meetings, events, webinars, and more, consider that NBA’s objective is to recommend optimal channels to sales reps based on individual HCP data and their prior touchpoints. This can be considered an optimization objective where the solution must develop and evaluate a sequence of HCP actions to maximize HCP engagement.

NBA technical solution

NBA follows the logic shown in the diagram below. It comprises multiple pre-calculation processes that are fed into the machine learning model, which then predicts and ranks the channels with the highest probability of engagement. As this is done on a per-HCP basis, it also generates personalized recommendations unique to each HCP.

A combination of historical HCP interaction data and other demographic data are utilized as input data. Three scores are created as a part of pre-model inputs:

  1. HCP channel affinity scores;
  2. HCP journey and timelines; and
  3. HCP's engagement consistency.

These three measures are primary to calculating the CEI, or in this case, the HCP Engagement Index (HEI). Numerous methods exist to compute HEI, but in this example, we will examine the most conventional and fundamental approach. Machine learning (ML) models such as Long short-term memory (LSTM) and sequence optimization models are used to optimize this HEI. Next, the model ranks the channels with the highest probability of engagement. Then, business rules are included in the flow, and the result is presented to the sales reps.  

As we are constructing a model that should analyze a series of HCP interactions and not just a one-time engagement, our technical solution computes the three crucial variables that, when combined, result in a ranking of suggested optimal channels. These three factors are:

  1. HCP engagement sequence generation;
  2. HCP channel affinity; and
  3. Consistency of engagement.

Sequencing HCP engagement entails reconstructing the distinct journeys of HCPs based on the temporal touchpoints of their engagement. Journeys are constructed by tracing the HCP touchpoints chronology for all HCPs throughout a specific time frame. Depicted below is an example of how an HCP engagement sequence is built.

HCP channel affinity: This is a measure that shows HCP channel preference across all channels in an omnichannel environment. For example, an HCP may prefer meeting face-to-face rather than phone conversations, whereas another HCP may wish to gather information via emails rather than meeting in person. The channel affinity score aggregates HCP interests in one table for all HCP’\s and for all the distinct channels.  Below are  examples of face-to-face affinity, call affinity, and email affinity.

  1. Face-to-face affinity: Assessed here is the willingness of HCPs to be visited by a pharmaceutical rep. This affinity is divided into High, Medium, and Low categories. Significant factors that determine face-to-face affinity include:
  • The number of visits index is the relative difference between an HCP's number of visits and the average value of all the associated HCPs. The greater the deviation index, the lower face-to-face affinity will be ranked.
  • The period between two meetings Index: This is the relative difference between the average number of days between two meetings with an HCP in comparison to other HCPs. The greater the deviation index, the poorer the affinity between two individuals.
  • Frequency of meetings: this is the difference between the median absolute distance per HCP and the group's mean value. Based on the median of all HCP meeting data, the median absolute distance quantifies the relative dispersion of data. The greater the deviation index, the poorer the affinity between two individuals.
  • Overall affinity for face-to-face is calculated by averaging all the indexes described in the above steps. The table below shows an example of calculating face-to-face affinity.
HCP Avg visits Relative avg visits Relative avg affinity to f2f Avg time b/w 2 meetings Rel avg time b/w 2 meetings Rel avg affinity to f2f Frequency Frequency index Overall f2f affinity
1 4 11% Med 30 7% High 8 High
2 6 17% High 15 4% High 3 High
3 5 14% Med 48 11% Med 10 Med
4 3 8% Low 60 14% Med 20 Med
5 6 17% High 90 21% Low 15 Med
6 4 11% Med 120 28% Low 30 Low
7 5 14% Med 10 2% High 2 High
8 3 8% Low 50 12% Low 17 Low

2. Call affinity is the inclination of an HCP to be reached by a pharmaceutical rep through the telephone. We divide the findings into High, Medium, and Low. Based on situations, call affinity may be rationalized differently; for instance, did the HCP express interest in the topic discussed, was the call transferred to someone else, was the interaction with the HCP fruitful, etc.

HCP Avg Call attempts Successful calls Notes Success rate Overall call affinity
1 4 3 Interested 75% High
2 7 3 Prefer face to face 43% Med
3 3 0 No response 0% Low
4 2 0 No response 0% Low
5 6 1 Not interested 17% Low
6 5 3 Delegated to others 17% Low
7 3 2 Fixed face to face 67% Med
8 5 2 No response 40% Med

3. Email affinity calculates an HCP’s propensity to interact through email. Email affinity calculation is more sophisticated than other channel affinity calculations. The majority of the rationales for filtering KPIs for email performance and affinity are driven by business rules. The fact that after an email has been sent, it might be opened several times in the future makes it more complex to specify what should be taken into account for email affinity calculations. For instance, if a rep sends an invite email ten days before a KOL event and an HCP only views the email 15 days later, there are no valuable insights to be derived. However, common measurements may be utilized for the computation of email affinity.

HCP Num of emails sent Num of email opened Email open rate Num of deep links in the emails Num of deep links clicked Click through rate Diff b/w days of emails sent and email opened Overall Email Affinity
1 7 3 → 43% 6 1 ↓ 17% ↓ 0 Low
2 7 5 ↑ 71% 4 1 ↓ 25% → 1 Med
3 5 5 ↑ 100% 5 2 → 40% → 1 Med
4 3 3 ↑ 100% 3 3 ↑ 100% ↑ 2 High
5 5 2 → 40% 10 6 → 60% → 1 Med
6 4 1 ↓ 25% 0 0 ↓ 0% → 1 Low
7 9 0 ↓ 0% 9 3 → 33% ↓ 0 Low
8 10 7 ↑ 70% 10 5 → 50% ↓ 0 Med

Similarly, affinity scores for all the channels can also be calculated. The overall HCP channel affinity can be combined into one table, as shown below.

HCP Overall F2F Affinity Overall call Affinity Overall Email Affinity
1 High High Low
2 High Med Med
3 Med Low Med
4 Med Low High
5 Med Low Med
6 Low Med Low
7 High Med Low
8 Low Med Med

Engagement consistency: the HEI calculation favors engagement consistency. The standard deviation of monthly interaction is used as an inverse measure of interaction's frequency or consistency. Observe that the mean for two HCPs is similar, and the standard deviation is used to determine the consistency.  “Low” is the standard deviation,  “High” represents consistency, and vice versa.

Jan Feb Mar Apr May Jun Mean STDEV
HCP 1 1 4 6 2 1 2 2.7 2.0
HCP 2 0 5 7 1 1 2 2.7 2.7

Calculating HEI

Depending on the significance of channels, weights are applied to each channel to calculate HEI. The business unit determines the importance of each channel's weight. For instance, face-to-face meetings may have more weight than emails since in a face-to-face meeting, HCPs devote full attention to reps' material and participate in the two-way discussion, while email engagement is measured only by open rates or click rates. These weights are empirical values that are subject to change between campaigns.

HEI = (∑Wf2f*F2F + ∑Wemail_rep*email_rep + ∑Wemail_Corp*email_corp+ ∑Wevents*Events) * Engagement consistency

Where W is the predetermined weight based on channel importance and i is the channel

HEI optimization

The last stage is to use machine learning to provide omnichannel recommendations by maximizing the HCP engagement index. The model is capable of learning engagement from marketing channel sequences and interactions in connection to HCP variables like preferences, specialization, demographics, etc . The results are displayed as  a ranked list of channels (first rank means the optimal course of action). The ranked list is used as input for the subsequent model, which includes business logic and advertising elements.

While there are several approaches to optimizing HEI, in this instance, LSTM can be utilized to optimize HEI via channel sequence prediction. LSTM is a recurrent neural network (RNN) architecture used in deep learning. LSTM networks are well-suited for categorizing, processing, and generating predictions based on temporal data. A visualization of LSTM training and prediction is shown in the above figure.


This article was intended to describe the HCP Engagement Index and forms part of the NBA series of blogs aimed at the commercial pharma industry:

We will also devote a separate blog post to different machine learning algorithms and describe how to choose the appropriate algorithm based on specific use cases.

Feel free to get in touch with us to start a conversation about operationalizing NBA in your organization.

Subscribe to our latest Insights

Subscribe to our latest Insights