2
$\begingroup$

I have a dataset of past emails sent, when they were sent and if they were opened. What would be the best model to predict the best time to send email?

I was thinking of modeling it as time series with values 1(email opened), 0(email not sent) and -1(email not opened).

$\endgroup$

3 Answers 3

4
$\begingroup$

Good question, probably a good handful of ways to look at this as it sounds like a classic classification problem.

Define the label

First step, before you choose a model, would be to define the label. As you suggested, I would go for email opened = 1 and email not opened = 0. I would then think about throwing the email not sent (-1) data away, as I'm not sure you can learn anything about a probability of opening when it wasn't sent.

It would then be important to check the balance of the label: are they mostly opened or mostly ignored? This will influence any decision to add a class weight if it is imbalanced towards one class.

Define features

So time series could work, but I think another good angle might be to bin the send times into half hourly slots (or shorter, depending on your needs) and treat them as a categorical variable. You would then one-hot encode this feature. Anything else you can add to this will probably help, such as the kind of person it was sent to and what country they're in etc.

Choose model

So it's classification, so have a play around with either logistic regression or something tree based (random forests, gradient boosted trees) to get something going quickly. It's usually a case of trial and error to find the best one.

You can then use traditional metrics of precision/recall/accuracy to measure how good it is. Make sure you know which metric is most important to your problem when optimising the model.

$\endgroup$
2
  • $\begingroup$ I would imaging that the subject line would be very important here. How would you control for that? I'm reminded of partial dependence plots but I'm not sure. $\endgroup$ Feb 21, 2018 at 16:18
  • $\begingroup$ Eesh good question. Depends on how many possibilities there are for the subject line contents. If there are a manageable number (and there is enough training data) it could be another categorical variable for one-hotting. It's not a question I could answer without being able to explore the data though I think - things like a barplot of subject line vs. open probability would be a start in seeing how influential it is. $\endgroup$
    – jshep
    Feb 21, 2018 at 16:24
2
$\begingroup$

Two things:

  1. EDA: To explore the best time in general. I would simply do visualizations. I would look at the conversion rates per time of sending. If I am interested in hourly time I would compute conversion rates per hour of sending. If the day of the week the same thing. NB: A customer can convert at any day/or time so it doesn't matter when they convert so long as they do convert when targeted.
  2. Modeling: Predicting the best time for each and every customer. I would do a classification model to predict. Two approaches:

Multi classification

  • If predicting the best day of the week My label would be the day of the week of targeting if only that customer converted (does not matter when they converted so long as they did convert when targeted on that particular day) otherwise the label would be 'not_convert'.

  • The same applies to predicting the hour of the day.

One model per time/day of interest

  • In this case, if my model is for let's say Wednesday(as the day of targeting), then my label would be a 1 if the customer converted when targeted on Wednesday and 0 if they did not convert when targeted on Wednesday. (Again it does not matter when they converted so long as they did convert when targeted on that particular day)

  • The same applies to predicting the hour of the day.

$\endgroup$
0
$\begingroup$

Have you spent any time exploring your data descriptively? Have you look at at simple counts and percentages of emails opened vs not opened by year, month, day, and perhaps time of day? The reason I'm asking is that you may find some answers simply by conducting an exploratory analysis and reviewing descriptives before you jump into modeling.

With regard to modeling, you could start with a logistic regression model where the outcome is email opened (1) vs email not opened (0). I don't think you should include email not sent as you do not need to predict that action; you know if the email was sent or not. For your predictors, you could partition your datetimes into multiple features, such as month, day, time of day, year, etc. You could also consider including additional predictors in your model, such as recipients' age, gender, location, etc., if these data are available to you.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.