Using Conditional Probability for my Instagram account

Many of us may find understanding statistics a challenging task. Moreover, when it comes to conditional probability, we may find ourselves scratching our heads. And yes, I am one of those people. Currently, I am on a journey to understand machine learning, and statistics, which is crucial in machine learning, is challenging for me to understand. So I decided to just finally sit down and not only understand the basic concept of conditional probability but implement it for my application. This way, I’ll have a proper understanding of the concept.

My Instagram Insights

My Instagram account has exhibited a decent amount of growth lately. Initially, I used to post randomly and whenever I wanted but then, I decided to consider my account insights. The insights gave me the following data of my account:

  • the percentage of male and female followers on my account
  • percentage of age group
  • top locations
  • number of followers gained and lost in the past month
  • the number of Instagram accounts reached.

My first step was to decide the objective; what do I want to achieve with these stats? After a bit of thinking, I decided to go for reach. I decided to use this data to increase my reach by determining when and at what time I need to publish a post so that it gets maximum reach on the platform.

conditional probability

Using Conditional Probability to determine the probability of maximum reach

As seen below, the bar graph illustrates the amount of reach I’ve had over the days of the week and time. The table below shows the data that Instagram insights provided me:

Day12 am3 am6 am9 am12 pm3 pm6 pm9 pmTotal Reach of the Day
Monday2840505869807247444
Tuesday2436455361646440387
Wednesday2838475459677043406
Thursday2536465262686443396
Friday2734455359656442389
Saturday2535425358676342385
Sunday2941506365767550449
Total Reach1862603253864334874723072856

Because I publish a post almost daily, the only parameter to consider here is the different times during the day. So framing the problem statement: At what time of the day do I need to publish a post to gain maximum reach?

For this, I summed up the reach for all the days at different timestamps. For example, I had a total of 186 accounts that were active at midnight on my posts in the week. Similarly, there were 260 active accounts in total at 3 am in that week, and so on. This ultimately resulted in a total of 2856 active accounts throughout the week.

Calculating Conditional Probability

Conditional probability, in simple terms, informs us about the chances of some event occurring under certain conditions. Some common examples are, “What are the chances that the bus will be delayed provided it is raining heavily on that day?” or “What are the chances that an F1 pilot will achieve a podium provided he got pole position?“. In our case, the event is having maximum reach and conditions are the different timestamps.

Hence, we will calculate the relative reach at different timestamps concerning the total number of accounts reached in that week. The following table illustrates probabilities at different timestamps:

TimestampCalculationConditional Probability
12:00 am180/28560.065
3:00 am260/28560.091
6:00 am325/28560.113
9:00 am386/28560.135
12:00 pm433/28560.151
3:00 pm487/28560.170
6:00 pm472/28560.165
9:00 pm307/28560.107

As seen in the table, posting at 3:00 pm yields the highest probability compared to other timestamps. Hence, 3:00 pm would be the optimum time to publish a post to gain maximum reach. Feel free to go ahead and try this out with your account. All you need to do is sum up the numbers and divide them by the total reach.

Conclusion

Conditional probability is one of the most fundamental topics in statistics and has scope in the field of machine learning. It tells us about the probability of some event taking place under certain condition/s. This allows us to have a narrower overview of that particular event and helps in decision-making accordingly.

If you enjoyed this hands-on application of conditional probability, consider joining my newsletter to stay updated on interesting posts on Machine Learning. Moreover, like and follow me on social media to stay updated with programming and machine learning information.

Leave a Reply