Request a demo
All articles Use case

Use case: a retail data science team forecasting demand on Oracle Cloud

A worked example with a made-up grocer. From a sales extract in Object Storage to a profiled dataset, a feature shortlist, a training job on OCI Data Science and a tracked comparison, with the agents doing the first pass.

November 15, 2026 · 5 min read

This is a worked example with a made-up organisation. Fernway Market is a fictional regional grocer with forty stores. Its small data science team forecasts weekly demand per store and category so that buyers order the right amount of fresh produce. The data lives in Oracle Cloud, and the team wants the first pass of analysis done for them so they can spend their time on modelling choices.

The AI Model Builder form with a plain-language use case and example use cases.
The AI Model Builder: describe the model in plain English. Demo data.

1. Profile the extract

A weekly sales extract lands as a CSV in an OCI Object Storage bucket. The data agent profiles it. The quality issues come back with severities: promo_flag is missing in a large share of rows (critical, over 50%), a few stores have duplicate weeks (a warning), and units_sold has outliers beyond 1.5 times the interquartile range in the weeks before public holidays. The language model's summary points out that the holiday outliers are probably real demand, not errors.

The team fills promo_flag from the promotions calendar, removes the duplicate weeks, and keeps the holiday peaks but adds a holiday feature so the model can learn them.

2. Shortlist features

The feature agent ranks features by mutual information with units_sold (a regression target). Lagged sales and the holiday flag rank highest. VIF is very high for avg_price and avg_price_incl_tax, which are almost the same number; the pair is also flagged as over 0.9 correlated, and the team keeps one. The language model suggests a price-to-category-average ratio and a week-of-year feature, with pandas code for each; the team tries both in separate tracked runs.

3. Choose an approach and train

The model agent recommends a few approaches for tabular weekly data and writes a training script for the one the team picks. After review, the training agent submits it as a job to OCI Data Science (by default on a flexible VM shape with 2 OCPUs and 16 GB of memory, which the team raises for the full dataset) and reads the metrics back. Its checks compare training and validation: a gap above 0.05 is flagged as mild overfitting, above 0.15 moderate, above 0.25 severe.

4. Track and compare

Each run is tracked with the SDK: the configuration snapshot, per-epoch training and validation loss, and a table of per-category error. Comparing runs side by side shows the price-ratio feature helps fresh produce and does nothing for dry goods.

Example · Fernway Market (made-up)

Where the agents saved time, and where they did not

The profile, the quality list, the feature ranking and the VIF table took minutes rather than an afternoon of notebook work, and they came out the same way every time. The decisions (keep the holiday peaks, drop the duplicate price, which approach to train) were the team's, informed by the numbers. The generated training script needed edits for the store hierarchy before the first job ran.

Clouds. In this example, training jobs, the model catalog, model deployment and pipelines run on OCI Data Science. The same steps go through one multi-cloud abstraction layer that also targets AWS SageMaker and Azure ML.

What the team keeps

At the end of the first cycle Fernway's team has a stored profile of the extract, a feature analysis with the VIF table, a set of tracked runs with their configurations, and the training job's metric analysis. When a buyer asks why the forecast for berries jumped, the answer starts from those records rather than from someone's memory of a notebook.

After release

  1. Register the chosen model as a new version and submit it for review.
  2. Deploy it to an OCI model deployment endpoint once approved.
  3. Keep the training extract as the drift reference.
  4. Run drift detection on each new week's inputs from your scheduler and review the report before deciding to retrain.

See drift detection with PSI and KS for how the last step works.

What the team would check before trusting the forecast

  • Time-based validation. The holdout weeks come after the training weeks. A random split of weekly data lets the model see the future and flatters every metric.
  • Lag features at prediction time. Last week's sales are known when buyers order; the current week's are not. The feature list is checked against what exists on the day the forecast is made.
  • Error by category, not just overall. The per-category error table is what showed that one feature helped produce and not dry goods; an overall figure would have hidden it.
  • The holiday weeks. They are a small share of rows and a large share of waste when forecast badly, so they get their own row in the evaluation.

When a job fails

The first full-dataset job runs out of memory on the default shape. The training agent's failure diagnosis reads the failure, suggests adjusted parameters (here, more memory) and can resubmit; resubmission is off by default and limited to three attempts when switched on. The team prefers to resubmit by hand after reading the suggestion, so the change is deliberate and recorded. Jobs also stop at a maximum runtime, two hours by default, which a full retrain may need raised.

Choosing the drift reference for seasonal data

Grocery demand is seasonal, so a December week compared with a training set that is mostly spring and summer will show drift that is just the calendar. Fernway's team keeps the full training extract as the fixed reference, reads drift per feature, and treats a seasonal shift in week_of_year-related features as expected. A shift in avg_price outside a promotion, or in the share of rows with a promotion, is the kind of change they act on.

Questions

Could the same workflow run on AWS?

Yes. The data, training and deployment steps here use OCI services; the same workflow goes through the multi-cloud layer to AWS SageMaker.

How much of the generated code was kept?

In this made-up example, the structure of the training script was kept and the parts that depend on the business (the store hierarchy, the validation split) were rewritten by the team, which is the normal outcome for generated code.

Run it on one of your own models

Bring a dataset and a model you already train. We profile it, track a run and measure drift with you in your own cloud.

Request a demo