Aller au contenu
Data & intelligence artificielle · Practical guide

Machine learning

Machine learning trains a statistical model on your historical data to predict an outcome: which clients may leave, what will sell next week, which message is a complaint. 40,000 to 250,000 MAD for a first model in Morocco.

Request a quote ↘

Some links on this page are affiliate links: we may earn a commission at no extra cost to you. Our approach

Machine learning turns historical data into predictive capability. The point is not to understand why a customer buys, but to spot the regularities that allow a behaviour to be anticipated. That is what distinguishes it from classic analysis, which describes the past. ## The most common uses in SMEs Three families come up often: churn prediction (which customer is likely to leave), demand forecasting (how many products to sell in the coming days) and message or document classification (complaints, invoices, applications). All rely on data the company already has, provided it is usable. ## Why data matters more than the algorithm A successful machine learning project spends most of its time cleaning, completing and structuring data. Algorithms are available in free libraries; what is often missing is a reliable history and variables that really describe the behaviour to be predicted. ## Naturally limited, so useful with safeguards A model must be framed: a human validates sensitive cases, decisions are explainable and the model can be switched off if necessary. It is within this framework that it adds most value: it automates triage and scoring, and leaves judgement to the team. ## An example on stock forecasting A cosmetics retailer wants to reduce stockouts and overstock. It brings together three years of sales per product and per store, past promotions, local weather and public holidays. A forecasting model provides an estimated demand over seven days. The gain does not come from the model alone, but from how buyers use it: a buyer adjusts with their judgement and the order is placed on time.

When this guide is for you

  • You have several months or years of history (orders, clients, incidents) and want forecasts from it
  • You need to automatically sort large volumes of messages, documents or images with measurable reliability
  • Your current decisions rest on fixed rules that do not adapt to real behaviour
  • You want to target retention actions or promotions on the most at-risk or most profitable clients
  • A simple model has already been tested and you need to move from test to production

Step by step

  1. Problem formulation — Translate the business need into a machine learning problem: predicting a value, a class or a ranking. Define the target variable, the prediction horizon and the metric that really matters to the business, not just technical accuracy.
  2. Data preparation — Build a clean training dataset: complete histories, relevant variables, handling of missing values and data leakage. This is the step that takes most time in a successful project.
  3. Training and comparing models — Test several approaches, from a simple model (logistic regression, tree) to more complex ones, with cross-validation. An interpretable model that is almost as accurate is often preferable in a company.
  4. Evaluation and deployment — Measure performance on data never seen before, then integrate the model into a system (API, daily batch) with prediction tracking and a plan to revert to the previous rule if it drifts.
  5. Monitoring and retraining — Monitor the quality of input data and real production performance. Retrain regularly when customer behaviour changes, and keep a record of model versions.

What it costs (in MAD)

ServiceIndicative priceGood to know
Scoping and feasibility10,000 – 30,000 MAD (≈ 90 – 2,700 €)Study of available data and achievable gain
Dataset design15,000 – 60,000 MAD (≈ 1,350 – 5,400 €)Cleaning, variables, usable history
Model development25,000 – 90,000 MAD (≈ 2,250 – 8,100 €)Depending on problem complexity and data quality
Deployment and API20,000 – 80,000 MAD (≈ 1,800 – 7,200 €)Integration into the IS, monitoring, security
Compute infrastructure500 – 8,000 MAD / month (≈ 45 – 720 €)Notebooks, GPU, storage depending on models
Monitoring and retraining5,000 – 20,000 MAD / month (≈ 450 – 1,800 €)Monitoring, versions, new data
Part-time or outsourced data scientist20,000 – 60,000 MAD / month (≈ 1,800 – 5,400 €)Rare profile in Morocco, often shared

Indicative ranges for the Moroccan market in 2026, excluding tax. Prices vary with scope and provider.

Mistakes to avoid

  • Launching a model without enough historical data, or with a history too short to capture seasonality
  • Leaking information into the input variables: the model shows perfect test performance and collapses in production
  • Choosing a complex model when a simple, interpretable one that is almost as accurate would do
  • Optimising a purely technical metric without linking it to a measurable business gain
  • Delivering a model without monitoring: quality degrades silently as behaviour changes

Frequently asked questions

How much data do you need for a first model?

It depends on the problem. For churn prediction on a file of a few thousand clients, a few months of history are enough. For image recognition or language processing, you often need far more, or a pre-trained model that you adapt.

Machine learning or generative AI?

Machine learning learns to predict from historical data (churn, forecasting, classification). Generative AI produces content from instructions. For sorting messages, both can be used; for forecasting sales, classic machine learning is better suited.

Is a model ever 100% reliable?

No. A model produces a probability or an estimate, with a measurable error rate. The goal is to define the threshold from which the error costs less than the gain, and to ensure a human takes over in ambiguous or sensitive cases.

Do you need an in-house team for machine learning?

Not for a first model: an external provider can deliver a prototype and train the team. In the long run, an internal profile (trained data analyst, data engineer, part-time data scientist) remains necessary to maintain and evolve the model.

What is the main failure factor?

Data quality and availability. A poorly built model on clean data can be fixed; a good model on incomplete, poorly labelled or unrepresentative data cannot work well.

Updated on

Related guides

Version française: /services/data-ia/machine-learning/ · AR · NL