cd /news/machine-learning/rules-engines-vs-machine-learning-fo… · home › topics › machine-learning › article
[ARTICLE · art-150465] src=dev.to ↗ pub= topic=machine-learning verified=true sentiment=· neutral

Rules Engines vs Machine Learning for Fitness App Personalization

A developer outlined a fitness app personalization approach that separates eligibility filtering from ranking, arguing that a rules engine with structured workout metadata and explicit constraints is sufficient for most requests while machine learning is only warranted for ranking eligible options when suitable interaction data exists. The writeup includes a Python example that filters workouts by available equipment, duration, and experience level, and warns that treating incomplete sessions as negative feedback can produce misleading recommendations.

by read4 min views1 publishedOct 15, 2026

A beginner with resistance bands asks your app for a 20-minute workout.

Do you need machine learning to answer that request?

Probably not. Structured workout metadata and explicit filters can handle it.

But if several workouts meet the requirements, deciding which ones a user will prefer is a different problem.

That distinction—eligibility versus ranking—is a useful starting point for fitness app personalization.

A rules engine evaluates predefined conditions against user inputs and workout information.

For example:

A small application may only need functions and decision tables. A dedicated rules-engine library becomes useful when rule management, versioning, or interactions demand it.

A constraint determines whether a workout is eligible. A preference influences its position among eligible options.

“No barbell available” should exclude barbell workouts.

“I usually prefer shorter sessions” may influence ranking without excluding every longer option.

Make these distinctions explicit. Otherwise, a high ranking score could accidentally override an important requirement.

Machine learning can help rank eligible workouts using relevant preferences, ratings, and historical interactions.

For example, users with identical equipment and schedules may prefer different session formats. A model could identify those patterns when suitable data exists.

However, define the prediction clearly.

Predicting a workout click is different from predicting completion. Neither alone proves training suitability.

An incomplete session might reflect difficulty, an interruption, or a logging mistake. Treating every incomplete workout as negative feedback can produce misleading recommendations.

Before modelling, establish which information your product actually needs:

Fitness App Data Collection Checklist

Factor Rules Engine Machine Learning
Decision logic Explicit conditions and priorities Patterns learned from suitable data
Data requirements Valid inputs and structured metadata Relevant features, interactions, and evaluation data
Explainability Traceable to matching rules Depends on model and explanation design
Initial complexity Often manageable for clear requirements Adds data preparation and evaluation
Adaptability Through authored logic and updated inputs Through model inputs and learning updates
Testing Boundaries, conflicts, and regressions Also data quality and prediction behaviour
Operating cost Application infrastructure and maintenance May add training, inference, and monitoring
Best fit Explicit requirements and limited history Ranking problems with measurable potential gains

Neither approach is universally cheaper or better. Compare the proposed implementation and its maintenance needs.

A hypothetical workout recommendation engine can follow this workflow:

Keep ranking replaceable. This lets you establish a rules-based baseline and evaluate ML later.

This example demonstrates eligibility filtering only. It does not implement complete training-plan design, progression, or medical screening.

from dataclasses import dataclass

@dataclass(frozen=True)
class Workout:
    workout_id: str
    equipment: frozenset[str]
    minutes: int
    level: str

def filter_workouts(
    workouts: list[Workout],
    available_equipment: frozenset[str],
    max_minutes: int,
    allowed_levels: frozenset[str],
) -> list[Workout]:
    if max_minutes <= 0:
        raise ValueError("max_minutes must be positive")

    if not allowed_levels:
        raise ValueError("Select at least one experience level")

    eligible = [
        workout
        for workout in workouts
        if workout.equipment.issubset(available_equipment)
        and 0 < workout.minutes <= max_minutes
        and workout.level in allowed_levels
    ]

    return sorted(eligible, key=lambda workout: workout.workout_id)

Sorting by identifier provides stable ordering; it is not preference ranking.

Validate workout metadata before this stage. Unknown equipment information should not automatically mean that no equipment is required.

If nothing matches, explain the unmet requirements instead of silently removing constraints.

Warning signs include:

First check whether the problem is architectural.

Duplicated conditions, inconsistent equipment labels, or mixed eligibility and ranking logic may be fixable without ML.

Consider a model when the remaining problem benefits from learning patterns and you can measure the improvement.

For broader product planning:

Rules-Based vs Machine Learning in Fitness App Development

Confirm that:

For multi-session plans, evaluate the schedule as a whole. Individually eligible workouts do not automatically form an appropriate programme.

Compare the proposed ranker with a credible baseline.

Assess relevance, coverage across user profiles, response latency, operating cost, and unsuitable recommendations.

When evaluating predictions about future behaviour, prevent future information from leaking into earlier predictions.

Record what users were shown as well as what they selected. Unseen workouts should not automatically become negative examples.

A limited pilot can then assess usefulness, completion, repeat use, and complaints. Engagement alone does not demonstrate fitness benefit.

Measuring Fitness App Recommendation Quality

Collect only necessary information, protect stored records and communications, and restrict access.

Let users correct outdated profile information. Explain recommendations using genuine selection factors rather than invented physiological claims.

Keep essential constraints independent of model scores. Avoid unsupported medical or injury-prevention assurances.

If wearable data affects recommendations, account for delayed, missing, and duplicated records:

Wearable Workout Data Handling

Version rules, models, and relevant metadata so unexpected results can be investigated and changes can be rolled back.

Use explicit rules for requirements you can define and test.

Consider machine learning when suitable data and evaluation demonstrate that learning improves recommendation ranking.

A hybrid architecture is an option, not a requirement. Keep the system understandable, measurable, and maintainable.

At what point would you replace a growing set of workout recommendation rules with a machine learning model?

── more in #machine-learning 4 stories · sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/rules-engines-vs-mac…] indexed:0 read:4min 2026-10-15 · —