Skip to content

July 1, 2026 • Ibexcode

Building an End-to-End ML Product Solo: From Data to Mobile App

Architecture of an end-to-end ML product, from data to the mobile application

When people talk about machine learning, they tend to focus on models, training, and performance metrics. But turning a model into a product people can use every day involves much more than that.

You need reliable data, preprocessing that avoids temporal leakage, realistic evaluation, automated workflows, and a way to deliver results to an application. And everything has to keep working when the data changes, a task fails, or a new version is deployed.

These are the challenges I’ve had to address while building a mobile product based on a predictive ranking system, where multiple candidates are ranked within events that unfold over time.

Today, the project brings together a Flutter application available on iOS and Android, a cloud backend, and an automated data and ML pipeline—from ingestion through to rankings and confidence estimates.

I won’t go into the business domain, datasets, features, or detailed model performance here. Instead, I want to focus on the engineering decisions needed to make all these pieces work together.


1. The Problem: Ranking Rather Than Simply Predicting

The task isn’t to predict a value for each observation independently. Each event contains several candidates, and their relative ordering is what matters.

Relative ranking of multiple candidates within the same event

That distinction changes how you approach modeling. A model can estimate an individual value accurately without necessarily placing the candidates in the right order within their event.

I therefore chose several modeling objectives that approach the problem from different angles. Some signals describe candidates individually, while others relate more directly to their relative positions.

The challenge is then to combine these signals without merely averaging scores that may not reflect their respective value.


2. A Multi-Level ML Architecture

To make use of these signals, the system relies on multi-level stacking.

Conceptual diagram of a multi-level stacking architecture

The idea is to make several models work together: the first models generate predictions, which become inputs for subsequent levels. Those later models can learn to exploit agreements, disagreements, and the different strengths of the models upstream.

The models don’t need to belong to the same family. Different approaches may represent candidates and their interactions differently, potentially providing complementary information.

The principle sounds straightforward. Making it reliable on temporal data is another matter, because each level must learn from predictions generated under conditions that genuinely resemble production.


3. The Central Challenge: Never Learn From the Future

With temporal data, conventional random cross-validation can give a highly misleading impression of performance.

For example, if a model uses observations from 2025 to generate a prediction supposedly representing what it could have known in 2023, the result no longer reflects a realistic situation. The model has benefited from information that didn’t yet exist at the simulated point in time.

This risk already exists for an individual model. With stacking, it can easily propagate between levels. If the first level predicts observations it was trained on, then passes those scores to the second level, the latter indirectly receives information influenced by the very outcomes it is trying to predict. The metrics can become artificially optimistic.

Strictly Temporal Out-of-Fold Predictions

To prevent this, the levels are built using future-only Out-of-Fold (OOF) predictions.

Future-only Out-of-Fold prediction principle

For each period, the model is trained exclusively on earlier history. It then predicts a period it hasn’t seen during training. Those outputs feed the next level, where the same precaution must be applied again.

This approach multiplies training runs and significantly increases experimentation costs. But it lets us answer a crucial question: what could the system actually have predicted on that date, using only the information available at the time?


4. Separating Ranking From Confidence

Producing a ranking and estimating how much confidence to place in it are related but distinct problems.

The first is about deciding which candidate should rank ahead of the others. The second is about estimating how reliable that result is for a particular use case.

The main pipeline therefore focuses on ranking. A later stage uses signals from the system to estimate confidence. These may include intermediate scores, score dispersion, gaps between candidates, and agreement across models. Those are only broad categories: the actual representation can be much richer.

This layer produces probabilities. But those probabilities need to mean something. If an event assigned a probability of 0.80 happens only about 60% of the time, the displayed value conveys excessive certainty, even if the ranking itself is useful.

That’s why I also evaluate calibration, using tools such as the Brier Score and analyses across probability bins. The goal is:

Predicted probability ≈ observed frequency

A system can be good at distinguishing candidates without being good at estimating their probabilities. The distinction between discrimination and calibration becomes especially important when the results are presented directly to users.


5. The Model Is Only One Part of the System

Even an excellent model is of little use if today’s data never arrives, its format changes, a processing step stops, or the results never reach the product.

You also need to ensure that features are computed consistently during training and inference, and that the model loaded in production is compatible with its preprocessing steps.

I therefore treated the pipeline as a production system in its own right, rather than a Python script to run every day.

Orchestrating Workflows With Airflow

Processing is orchestrated with Apache Airflow. The daily workflow can be represented as follows:

Daily processing pipeline orchestrated with Apache Airflow

Airflow handles task dependencies, retries, execution history, parallelism, and workflow monitoring. The point is to avoid relying on a sequence of manual actions to know what ran and what still needs to run.

Another essential property is idempotency. If a task fails, retrying it shouldn’t duplicate data or leave the system in an inconsistent state. It’s much less exciting than a new ML model, but considerably more important once the system is in production.

Monitoring Data, Not Just Errors

An unavailable data source is usually easy to spot. Silent changes are harder: an API may continue responding successfully while changing a field, a category, a value convention, or the distribution of its data.

In that situation, the pipeline may run without raising an exception and still produce degraded predictions.

Checks therefore run at ingestion time: data presence and structure, volumes, unknown categories, unusual values, and distributions. The goal is to catch anomalies as close to their source as possible, rather than discovering weeks later that a metric has deteriorated.

Versioning Everything the Model Actually Depends On

A model isn’t just a weights file. It also depends on its configuration, data transformations, and, where applicable, categorical vocabularies and calibration.

Consider categories: if their encoding is rebuilt differently during inference, the same value may be interpreted differently by the model. The program may continue running, but its predictions no longer match the validated behavior.

The required artifacts are therefore stored and versioned together:

model/
├── weights
├── configuration
├── categorical vocabulary
├── preprocessing information
├── calibration
└── metrics

The goal isn’t merely to reload model.bin; it’s to recover all the conditions required to use the model correctly.

Avoiding Training-Serving Inconsistencies

Even with versioned artifacts, problems can arise when data is prepared differently in different environments.

A feature might be calculated one way during training and slightly differently in production. No obvious technical error necessarily occurs, and predictions keep coming out, but the model no longer receives data in the form it learned from.

This is known as training-serving skew. It can affect feature order, normalization, categorical encoding, aggregation windows, missing values, or the way intermediate signals are combined.

TRAINING  ──► feature construction ──► model

INFERENCE ──► feature construction ──► model

Both paths must produce consistent representations. To limit divergence, schemas and transformations need versioning, processing logic should be shared where possible, and outputs should be checked.

This also applies to stacking: one model’s output becomes the next model’s input contract.

Training-serving skew shouldn’t be confused with data leakage. Leakage involves using information that shouldn’t have been available at the simulated time. Training-serving skew concerns differences between the data seen during training and the data actually supplied in production. A pipeline can respect chronology perfectly and still suffer from the latter.


6. From the ML Server to the Cloud Backend

Once predictions have been computed and validated, they still need to reach the application. To achieve that, I separated responsibilities between the ML infrastructure and the cloud backend.

The former handles computationally intensive processing. The latter exposes results and manages users, authentication, access rights, subscriptions, and interactions with the mobile platforms.

Validated predictions are published to a cloud database from which the application can consume them.

Separation between ML infrastructure, cloud backend, and mobile application

This separation prevents the client from depending directly on the inference server. If a recalculation is delayed or the pipeline becomes temporarily unavailable, the application can continue operating from the last valid published state.

Mobile Subscriptions Bring Their Own Complexity

Selling the application on iOS and Android introduces a different set of problems, largely unrelated to machine learning.

Purchases are made through Apple or Google, but the backend needs to determine which entitlements each user should receive. It must account for new subscriptions, renewals, expirations, cancellations, purchase restoration, server notifications, and device changes.

Trusting only a state reported by the phone would be risky. The backend therefore maintains its own representation of entitlements, synchronized with information from the platforms.

This illustrates the reality of an ML product: once a model is integrated into a commercial application, issues that have nothing to do with prediction become just as essential to keeping the product running.


7. Flutter as the Final Layer

The mobile client is built with Flutter, sharing one codebase across iOS and Android.

It doesn’t need to know the details of the ML pipeline. It receives results that are already prepared and structured:

Event
  │
  ├── ranked candidates
  ├── scores
  ├── confidence levels
  └── associated information

This decoupling is deliberate. The phone doesn’t need to reproduce feature engineering or execute the ranking models. It focuses on presenting information and handling user interactions.

It also allows the prediction pipeline to evolve without publishing a new app version every time an internal component changes.


8. Automating Deployment and Operations

When you’re designing and maintaining a system that spans so many areas on your own, every recurring manual operation eventually becomes a burden.

I therefore tried to automate wherever it made sense: Docker containerization, CI/CD, deployments, infrastructure configuration, service management, and monitoring.

The aim isn’t to add tools for the sake of adding technical layers. It’s to reduce the number of interventions required to keep the product running, while limiting mistakes caused by manual operations.

Automation isn’t merely a convenience here. It directly shapes architectural decisions and the project’s long-term maintainability.


9. From Experimental Model to Production ML System

During research, performance naturally gets most of the attention. Once the system is in production, you also need to reproduce training runs, explain predictions, detect data anomalies, and roll back cleanly to an earlier version.

That means ensuring temporal predictions never use future information, workflows can recover from failures, and transformations remain consistent between training and inference. You also need to identify incomplete runs without exposing partial results to users.

Finally, a new model version shouldn’t be judged solely on its standalone performance: it must be compared with the system already in place.

A Promising Experiment Isn’t Necessarily an Improvement

During development, I’ve explored different model families, architectures, features, and combination strategies. Not every experiment produces a gain, and that’s normal.

Before adopting a change, its behavior needs to be checked through the complete validation protocol:

Validation protocol before promoting an experimental change

A model that performs slightly worse on its own may provide complementary successes to other models. Conversely, a strong standalone model may contribute nothing if it reproduces information already present in the ensemble.

That’s why I also examine error correlation, model complementarity, the statistical robustness of measured differences, and above all the actual effect of each change on the stack’s final output.


10. An Architecture Spanning Several Disciplines

This project has taken me across the entire stack, from data engineering and machine learning to the cloud backend and mobile applications.

Overall architecture, from data engineering to the mobile application

I designed and implemented its different layers. The difficulty isn’t only mastering each technology; it’s making decisions at the boundaries between them.

A feature-engineering change can alter inference conditions. A new model version must remain compatible with its preprocessing. The backend must expose results without depending on the immediate availability of ML computation. And the product should be able to evolve without requiring the entire infrastructure to be redeployed.

Building a system like this alone forces you to make deliberate choices about complexity. You have to decide where separation adds real value, what deserves automation, and what can remain simple. The point isn’t to multiply components, but to build a pipeline whose parts remain understandable, testable, and maintainable.


11. Conclusion

Building this product has shown me how much machine learning changes when it has to work every day inside an application used by real people.

The project uses a broad set of technologies: Python, LightGBM, CatBoost, DeepSets, Set Transformers, MLP architectures and tabular Transformers, PyTorch, Airflow, Docker, infrastructure as code, Firebase, and Flutter. But their value isn’t measured by how many tools are involved. It comes from how they fit together to deliver a reliable, usable service.

The work doesn’t end with training a high-performing model. You need control over the data it consumes, the conditions under which its predictions are validated, how the workflows execute, and how results reach the application.

It also changes how you evaluate progress: a new feature, a more sophisticated architecture, or a better local metric only matters if it delivers a real benefit to the complete system.

In upcoming articles, I’ll explore several of these topics in more detail: temporal validation and leakage-free stacking, diversity between models, ML experiments that fail to deliver gains, and monitoring a production data pipeline.