Session Planning

Published Feb. 13, 2024

TL;DR - As a LHF user, I set how many muscles I want to work in a session. Let's call that number "N". The algorithm suggests:

  1. N - 1 coldest exercises for my coldest muscles
  2. One absolute coldest exercise, the single exercise I haven't done in the longest time

"Cold" refers to how long it's been since I used the muscle or performed the exercise. The longer it's been, the colder the muscle or exercise.

Exercise-based Planning Algorithm

When I plan a workout session in LHF, I'm greeted with an explainer sidebar:

Screenshot listing user's coldest muscles in order from coldest to warmest

This sidebar is a glimpse into the algorithm that powers LHF's suggestions.

LHF strives to work my coldest muscles. If I worked my chest yesterday, that muscle is "hot". LHF lets it recover by scheduling non-chest muscles in the upcoming session. LHF tracks all the muscles I work each session and prioritizes muscles that haven't activated in the longest time. LHF activates these muscles by combing through my exercise database for the exercise that I haven't done recently that targets the cold muscle.

Problems with the Algorithm

I knew I had a problem with the planning algorithm. I shoot for four strength training sessions a week. Over the months I noticed inconsistencies with the exercises LHF suggested for me. There were some exercises, like the Sled Push, that never made it to my suggested session. There were some exercises, like Rope Wave, that I felt like I was doing frequently.

I finally had some time to analyze the probability distribution of LHF's planning algorithm. I created a fake user that did 729 sets of LHF-suggested exercises. Why that number? 243 is the total number of exercises in the LHF exercise database at the time of this writing. I multiplied that by 3 to give the planning algorithm some extra sets to incorporate the missing exercises, like Sled Push. 243 * 3 = 729. Going into this analysis, part of me wanted to examine the 243 exercises over the 729 sets and find that each exercise was performed 3 times. This signifies that LHF treats each exercise fairly. Here's the distribution curve I actually found:

Probability distribution graph showing majority at 3 but outliers at 0 and 11

While the majority of exercises hit that number 3 sweet spot I was hoping for, there are outliers. I had to dig in.

Too Frequent Exercises

There are some exercises that each occur more than ten times:

Exercise Count
Alternating Rope Wave 10
Face Pull 11
Horizontal Internal Shoulder Rotation – Dumbbell 11
Internal Shoulder Rotation – Band 11
Lying Internal Shoulder Rotation – Dumbbell 11
One-Handed Wrist Extension – Dumbbell 11
Wrist Extension – Barbell 11
Rope Wave 12

Examining those exercises, I came to the conclusion that this doesn't reflect a bug in the code, but a data problem, namely an exercise data problem. There are some muscles that have few targeting exercises. For example, LHF has four exercises that target my outer forearm:

  1. Alternating Rope Wave
  2. One-handed Wrist Extension - Dumbbell
  3. Rope Wave
  4. Wrist Extention - Barbell

Sure enough, those four exercises occur among the most frequently planned exercises. That's because there's no other way for LHF to target my outer forearm when it's the coldest muscle. LHF reaches for the only outer forearm exercises it has when it's time to schedule that muscle.

What's the solution to this problem? Add more exercises! I love this solution because hunting for new exercises is something I enjoy doing anyway.

It's hard to classify LHF's behavior as a "problem". I'm still working my outer forearm, I'm just not getting as much variety as with other muscles. This issue will fix itself over time as I add more exercises to the directory.

Hidden Exercises

Now this is a real problem:

Exercise Count
Cable Pull Through 0
Frog Pumps – Dumbbell 0
Hip Thrust – Machine 0
One-Legged Hip Thrust 0
Sled Push 0

Given 729 opportunities, LHF's planning algorithm never picked these five available exercises. I call these "hidden exercises". Examining the data, I found that the exercises are hidden because they specialize in a popular muscle, the glute!

At the time of this writing there are 67 exercises that activate the glute as a primary muscle. Most of these are what we call "compound exercises". A compound exercise is one that works multiple muscles. Take a Barbell Squat, for example. The Barbell Squat works my glute, lower back, quad, and inner thigh. That's four primary muscles in one exercise.

LHF's planning algorithm may choose to do a Barbell Squat any time one of those four muscles comes up as a cold muscle. Let's follow the steps that lead to our hidden exercises:

  1. Time to plan a session! Click.
  2. LHF determines my quads are cold.
  3. LHF recommends a Barbell Squat
  4. I do it.

At this point, I activate all four muscles (glute, lower back, quad, and inner thigh) and LHF considers them "warm". The next time I plan a session, my glutes won't come up as a cold muscle. With 67 glute-busting exercises, LHF's planning algorithm never got a chance to focus on the exercises that specialize in glutes. The glutes were constantly worked by other, compound exercises.

What's the solution to this problem? I fixed it with what I call the "dredge". I explained the dredge in #2 from this post's TL;DR. When I ask LHF to plan a session, it not only searches for the coldest exercises for my coldest muscles. LHF also searches for the coldest exercise of all muscles. This extra step gives LHF a chance to consider hidden exercises.

Results

There's a small but significant difference to LHF's planning algorithm before and after the dredge. Here are distribution graphs of both algorithms:

Probability distribution graph showing majority at 3 but outliers at 0 and 11
Before
Probability distribution graph showing majority at 3 but outliers at 2 and 10
After

They look… very similar 😂 But there is a difference. Graphing the latest algorithm shows that no exercise drops to zero. Related, LHF increased its likelihood to hit that "3" sweet spot.

Here's another way to compare the two algorithms. We look at the exercise frequency in numbers:

Before After
Count 243 243
Mean 3.004115 3.004115
Standard Deviation 2.163747 1.692223
Minimum 0 2
25% 2 2
50% 3 3
75% 3 3
Maximum 12 10

LHF leaves no exercises behind now. Every exercise I add to the directory will make its way into my routine.