MT-ing My Head

Welcome to my soapbox of Salesforce technical writing, music, and miscellaneous stuff

An Intro to Predictive Modeling for Salesforce Peeps — April 16, 2021

An Intro to Predictive Modeling for Salesforce Peeps

I wanted to write about prediction because it’s seemingly everywhere: in marketing emails, in real estate, and even in criminal justice (blah).

An understanding of prediction and modeling can be pretty beneficial in business, however. Think lead scoring for new prospective clients or donors, employee attrition, or revenue forecasting. By understanding the capabilities of prediction, it might help us predict what data to collect in order to make more informed decisions.

Salesforce has released some A.I. products over the last few years under various names: Einstein, Tableau CRM, Wave Analytics. We can also create models ourselves, using different programming languages such as R and Python, or even in Excel.

First, a quote.

“All models are wrong, but some are useful”

George E. P. Box

Human nature can be unpredictable. We are also biased and have blind spots. I recently watched the documentary Coded Bias on Netflix, which showed how bad models can affect real people. So handle prediction with care.

So how does prediction work?

A predictive model tells us, based on existing criteria, what outcome is expected. For instance, what is someone’s income based on their race, gender, and profession?

Think of this as a mathematical formula similar to the ones we learn in high school for a straight line or a parabola. The inputs are x and the outputs are y.

y=mx+b

y=x^2

y=1/x

To build a predictive model, we use mathematical methods to find a formula that provides an output that is as close as possible to the real output for the greatest number of records (e.g. people, schools, whatever).

We can use both categorical (e.g. picklists) and numeric values in prediction.

So let’s say we want to predict a donor’s 2021 donation amount. We can use a method called regression.

In order to build a model to predict someone’s next donation amount, we need a “training data set” – a report of donors who have made 2021 Donations. We choose fields we think may be relevant (called independent variables, e.g. Age, Gender, Last Donation Amount, and Average Donation Size) and a “target” dependent variable (a field called 2021 Donation Amount.)

Then, we use a tool (Excel, R, Python, or a calculator with a huge memory :P) to create the model. Our goal is to get the most accurate model, so we may remove variables that don’t add that much value.

Our final output might look like this:

ŷ (this is the predicted value of 2021 Donation Amount) = 10 (this is the y-intercept) + 1.4*Age + 1.5*GenderFemale(true=1 or false=0) + 1.02*LastDonationAmount + 0.01*AverageDonationSize

So to predict the next donation amount of a donor who is:

  • Age = 45
  • Gender = Male
  • LastDonationAmount=$200
  • AverageDonationSize=$250

We would calculate the predicted value here:

ŷ = 10 + (1.4*45) + (1.5*0)+(1.02*200)+(.01*250)

ŷ = $279.50

NOTE: This is not a real model, and I am also oversimplifying.

From this result, we can see that the predicted donation amount for 2021 is higher than the donor’s last donation amount and average donation. Perhaps, in our fictional world, donors are very generous in 2021.

Conclusion and Disclaimer

I am passionate about educating people on how different technology works and hopefully saving them some money. However, I am a student and I am writing about what I am learning in class at the current time, and I am not an expert.

If you’re interested in learning more, check out online courses on modeling with R or Python, and then apply these skills to your Salesforce data. Courses will be able to explain some of the road bumps to look out for (e.g. multicollinearity, non-normality) and go more into detail about how to figure out if your model is actually a reliable one.

The example above is what is called linear regression. Logistic regression is another type of model…a way to predict the likelihood of an event. A famous example is whether or not someone died on the Titanic, which, spoiler alert: given a number of variables, is predicted best gender (“women and children” first) and ticket level (a proxy for wealth). I don’t know which method would be quicker for me: watching the 2 1/2 hour Kate Winslet and Leonardo DiCaprio movie or trying to build a model in R, but I digress…

Happy modeling!

Adding Google Calendar to My Mac’s Dock and The Value of Taking a Step Back — January 14, 2021

Adding Google Calendar to My Mac’s Dock and The Value of Taking a Step Back

I recently purchased a second monitor. For some reason, this felt like a decadent, hedonistic act to me, like buying Teslas for the police while education budgets get cut. It’s possible that I have just been inside too long, though. :~)

As a result of this purchase, I have started thinking more about ergonomics, productivity, and workflow. Mostly how to use each monitor. I decided it would be super helpful to see my daily calendar in one portion of the screen. Ideally, it would act more like an app than a browser window.

I’ll start by saying that I’m on a Mac and I have an aversion to Outlook. Additionally, I do like Apple’s Calendar app. It is clean-looking (like most Apple products) and it sits right on my dock. It doesn’t get lost in my endless tabs.

But there are downsides of using it, too. I prefer working in Google for a variety of reasons, including the cute graphics they put on my calendar and the ease of adding a Hangout to a meeting.

Today I decided to Google “Add Google Calendar to Dock on a Mac”. Within seconds I found a StackExchange article about how to do this and installed a program called Fluid. Fluid allows users to create an “App” out of any web link and add it to their dock.

I installed the software and, in five minutes, had a new icon on my dock.

Step 1: Install the software

You can install the software here: https://fluidapp.com/

Step 2: Create the App

Note: I used a custom icon because the favicon option didn’t work. The downside of this is that it’s statically saying it’s the 31st, instead of changing with the date like Apple Calendar does.

Step 3: Add to Dock

I added the icon to my dock. It’s not exactly transparent on the edges but good enough.

Google calendar icon in dock
Brand new Google calendar icon!
Now when I open it, it looks like an app and not a browser window! Won’t get lost in tabs! Hoorah!

This Fluid app has some other use cases as well. For instance, I can make “Apps” for my Salesforce CRM homepage or a list of common links I use. I can also have them launch when I turn on my computer.

I find it really valuable to take inventory of things that bother me about my setup at work and at home – whether it’s that I can’t see my little screen or I don’t know how to store a lint roller. I usually spend some time every month trying to fix these issues. I realize that with certain tasks, these small annoyances create a lot of avoidance and stress. Sometimes taking the time to Google something can prevent a lot of pain later.

I remember reading about this in The Happiness Project by Gretchen Rubin a few years ago. She mentions that although it’s common knowledge that spending excessively won’t bring true joy, sometimes spending money on tools to fix (or taking time to troubleshoot) day-to-day issues is extremely gratifying.

Do you have a small annoyance inventory? What small annoyance can you alleviate today?