How to structure data for generated training sessions?

I have a project I have wanted to do for a long time. I do personal training and while I love to plan workouts I hate that it takes time for each different athlete.

I base my next session on how they felt in the current session then I make modifications…more or less resistance, more or less reps, a progression of exercises or a regression, etc

I want to figure out how to program an engine that takes the feedback and then plans a new session.

I’ve tried this before with very basic recommendation type apps, but they are too simplistic for a real functional and sophisticated app.

If I could have my clients input feedback on an app and then have it create a new session and populate their training plan I can check it and optimize rather than building it from scratch.

I fee like I would need a big data structure like a node (for one session)-> feedback-> creation of 1-3 new training sessions to deliver over the week and feedback on those, and each would creat 2-3 more sessions…

In my mind it would get unwieldy, but I can’t figure out how I do this in reality, I don’t have exponentially growing workouts in my brain for each athlete,

How do I store and manipulate and retrieve all of these datapoints?

It sounds like a rather big challenge. But I think of some sort of database as a foundation. You may have tables for users, exercises, feedback, sessions and plans (whatever you want to name the structure). The database can be manipulated in hundreds of different ways.

The most popular tools are React (frontend), Node (backend) and MySQL (database). But other can maybe suggest other tools.

In the first place I should search if there are some off-the-shelf solutions unless you really want to challenge yourself.

Have you set up, for example, a spreadsheet for this? It would give you a sort of stepping-stone - it might help clarify what your data points and formulas are, and perhaps it’d help start defining data structure ideas.

This could be very useful, and powerful…and maybe even pretty lightweight. Any front-end you like, framework or non, and either a node storage setup or a serverless option (like Firebase or Supabase).

Sounds fun!

I don’t fully understand what you want to do.

So basically you you got a training session with the training-program S1, then you get feedback for S1 (say F1) and want to create a new S2 based on F1? Or do you want to create S2_1, S2_2, S2_3, because you talk about making three sessions?

I don’t know much about personal training, though obviously there is no point in branching out the new sessions exponentially. You should just base the feedback on the 3 sessions to create 3 new sessions, if you want to get 3 recommendations.

This way you basically take 3 feedbacks to generate an “average expectation” kinda thing and use that to generate 3 new sessions. The first feedback would be the “average expectation” as a starting point.

How you’d organize the data for this, heavily depends on how you model the session-data and the feedback - and what the algorithms is actually meant to produce.
That’s something only you can know, because only you know what considerations you take into planning and how you could automate them.

1 Like

Interestingly, I’m hearing applications of stock market formulas. This sounds like an exponential moving average (EMA), where the weighted results of the last N events help shape predictions of the next one.

@Sibert

I love a challenge, that’s the whole reason I’m here. :slight_smile:

i’m very familiar with the tools available such as Sql, Node, React, etc. I’ve done a number of the challenges here.

I’m more “stuck” on how to structure the data, generate algorithms, for example, in a logical and efficient way, and how to efficiently retrieve the “right” information for a user.

i’ll try to write a new post that clarifies my thoughts better.

@snowmonkey
I have and teh spreadsheet starts to get unwieldy. So I think the draw for me in a programatic solution is containing the data and retrieving it.

@Jagaya
great questions. Let me see of I can summarize with an example:
Let’s say a triathlete has this assigned swimming session that I’d use as a test set and give to everyone on their first day of training

10 repeats of 100 yards with 10 seconds rest, maintain the same pace for each 100yd effort. For their first test, it can be any pace, I just want them to finish it as written.

They attempt the set, and there are a few different possible results, here are some examples.

  1. They did it as stated
  2. They did it but needed more rest to finish 10 repeats at the same pace
  3. They did it but slowed down at the end, but held the same rest

SO the algorithm would need to check for adherence to the different variables, in this set:
-number of repeats
-pace
-amount of rest

For other workotus, or a spin off of this, there may be diffeernt variables.
let’s take Case 1, completed as stated.
The next set could go 1 of 3 ways depending on my training objective
ENDURANCE Objectives
Hold the same pace while :

  1. Swim more repeats (15 instead of 10)
  2. Swim longer repeats (150 yard instead of 100)
  3. Take less rest (5 seconds instead of 10)

SPEED Objectives:
Hold the repeats, distance and sendoff* while

  1. Swimming Faster pace by 1-2%
  • sendoff is calculated from pace entered by athlete, plus the rest in the first session. so athlete 1 may have swim 1:30 (1 minute, 30 seconds), with 10 seconds rest for a send off of 1:40; athlete 2 may have swim 1:10 with 10 seconds rest so their sendoff is 1:20)

One athlete could then have 4 different spinoff workouts as a result of the first set done as stated.


I could keep going with the examples, but that would just be the first layer for 1 athlete.

@snowmonkey
That’s really interesting, I’ll mull over it.

(post deleted by author)

So trying to clarify the problem, there are

training variables that are objective data

  1. total distance (10 repeats of 100 yards = 1000 yds total distance)
  2. pace
  3. interval number
  4. interval distance
  5. rest between intervals
  6. number of sets (2 sets fo 10 x 100 for example)

Then there are training principals that would be based in exercise science, but each coach may interpret differntly
principals to increase endurance:

  1. more repeats
  2. longer repeats
  3. more sets
  4. longer total distance (1 x 2 x 3)
  5. less rest between repeats or sets

principals to increase speed

  1. swim faster with same rest
  2. If that’s not accomplished, swim faster with more rest (next round)
  3. breakdown into components like arm tempo and stroke length (but this gets murky)

Of course this is just for the data of training, not the technique whih in swimming is important, biking still present but less so.

hm… and how would the feedback sound and what decisions is the algorithm supposed to make?

If we start at the bottom, the program could take the current training, the feedback and then determin if it has to “sets up” and “repeats down” OR the other way around OR “pause down”.
That shouldn’t be to hard.

If it’s supposed to mix up the exercises, you could give it a list of possible exercises and it chooses some randomly. Maybe nest them in another list of objectives the exercise can achieve.

As to how you could save it… doesn’t really seem to matter. You have a limited dataset and don’t need to look a lot of stuff up. Because you are working with one person and one goal and only 3 sessions to “predict”, even a basic list would do, populated with the training-sessions as either dictionairie with the key-value pairs of whatever metrics you use, or if you wanna be fancy as objects with attributes and methods.

At least with my understanding, getting the actual algorithm to work seems like the bigger issues.
But then again, it really depends on how it is supposed to analyze the data.

@Jagaya
As a real coach, I might give this client 2 worktous for the week based on the result, and ask them to do both since I would want to plan ahead at least a week in advance

Let’s say the client did the set as described (10 x 100 with 10 seconds rest). I’d extract the pace from the feedback (from a swim watch upload for example)

  1. 15 x 100, same pace, same rest (increasing total distance/repetitions, and seeing if they can hold the same pace) Objective is holding pace for more repeats under the same rest conditions

  2. 10 x 200, 20 seconds rest (increasing repeat length but also giving more rest to maximize success of teh objective, which is to increase continuous swimming distance at the same pace)

===========
At the end of teh week there will be feedbzck from these 2 workouts, adn each one could be expanded again…OR they could converge to the similar outcome. If he or she did both these, they are converging on a an endurance set 1500-2000 yards in length.

So I may want to try a set like 4 x 400 yards, so taht the total distance sits between the average of 2 other endurance sets, but increasing repeat distance to test how far they can swim without rest.

==========

Those are a few practical examples. Does that help answer your question?