Machine learning is a branch of artificial intelligence in which software learns patterns from data to make predictions or decisions, not hand-written rules. In e-commerce and pricing it is used to forecast demand, estimate how buyers respond to price and recognise when two listings are the same product.
Learning from examples instead of rules
A traditional pricing rule might say: if a competitor drops below us, match them, but never go under cost plus 15 percent. Every condition is written by a person. A machine learning model is instead given many past examples, such as prices, dates, stock levels and the sales that followed, and it adjusts its internal parameters until its predictions fit those examples well.
The result is a model that can make a prediction for a new situation it has not seen exactly before. Its quality depends on whether the new situation resembles the data it learned from.
Training is usually followed by testing on data the model did not see. A common approach holds back the most recent months, trains on everything before them and checks how well the model predicts the held-back period. If accuracy drops sharply on the unseen data, the model has learned the past too closely and will not generalise.
Main types of learning
- Supervised learning learns from labelled examples, such as past prices paired with units sold, and predicts the label for new cases.
- Unsupervised learning finds structure in unlabelled data, such as grouping customers or products with similar behaviour.
- Reinforcement learning tries actions, observes the reward and gradually prefers actions that pay off, an approach studied for sequential pricing decisions.
Most practical retail uses are supervised. The model families range from simple linear regression to decision tree ensembles and neural networks. A simpler model that the team understands is often more useful than a complex one that nobody can explain.
Common uses in pricing and e-commerce
- Demand forecasting, to plan stock and promotions
- Estimating price elasticity for products with enough sales history
- Product matching, to decide whether two listings with different titles are the same item
- Recommendations and search ranking on store pages
- Fraud screening at checkout
- Markdown planning for seasonal stock
Product matching shows how the technique fits with competitor data. Titles, brands, model numbers, images and attributes are compared, and a model scores how likely two listings are to be the same product. A wrong match leads to a wrong price comparison, so matches with low confidence are usually reviewed by a person.
Forecasting is often the easiest place to start. A model that predicts next month’s units for each product does not change any price by itself, but it helps buyers order stock, plan promotions and spot products whose sales are drifting away from expectations. Because the forecast can be checked against reality every week, trust is built step by step.
An example: predicting price response
Imagine, as an example, a pet supplies shop with two years of daily data for a bag of dog food: its own price, the lowest tracked competitor price, weekday, season and units sold. A model trained on this data might estimate that at 52 dollars, with competitors at 50, the shop sells about 30 bags a day, and at 49 dollars about 38 bags. Combined with unit cost, these estimates let the team compare expected profit at each price.
The estimates only hold inside the range the model has seen. If the shop has never charged above 55 dollars, a prediction at 65 dollars is guesswork dressed up as a number. Good practice is to test new price levels carefully and feed the results back into the data.
Data comes first
A model is only as good as its inputs. Missing days, prices recorded with the wrong currency, stock-outs that look like low demand and promotions that are not flagged all teach the model the wrong lesson. Cleaning and labelling data usually takes more effort than training the model itself.
Competitor prices are a common input, and they need the same care. A long, consistent record of competitor prices and availability, such as the one kept by price history, gives any analysis, whether a spreadsheet or a model, a more reliable base.
Risks and limits
- Overfitting, where a model memorises past noise and predicts poorly on new data
- Feedback loops, where several automated systems react to each other and prices drift
- Opaque decisions that staff cannot explain to customers or regulators
- Bias, if the data or features lead to unfair outcomes for groups of customers
- Concept drift, where market behaviour changes and an old model keeps acting on outdated patterns
Rules on automated decisions, personal data and pricing differ by country. Using personal data to set individual prices can raise legal and ethical questions, and expert legal advice is worth seeking before doing so.
Using machine learning responsibly
Keep humans in charge of the boundaries. Price floors, ceilings and maximum daily changes should be set by the business and enforced regardless of what any model suggests. Start with forecasts that support a decision rather than models that change prices directly, monitor accuracy against what really happens, and retrain or retire models when their error grows.
It also helps to compare every model with a simple baseline, such as last year’s sales for the same week or a moving average. If a sophisticated model cannot clearly beat that baseline, the extra complexity is not earning its keep. Document what each model does, which data it uses and who is responsible for it, so that decisions remain traceable when staff change.
Key takeaways
- Machine learning learns patterns from data instead of following hand-written rules.
- In e-commerce it supports demand forecasting, price response estimates and product matching.
- Predictions are only reliable inside the range of situations the model has seen.
- Clean, consistent data, including competitor prices, matters more than model complexity.
- Business-set floors, ceilings and human review should bound any automated decision.
Frequently asked questions
Is machine learning the same as artificial intelligence?
Machine learning is one part of artificial intelligence. AI is the broad field of making software perform tasks that seem intelligent, while machine learning is the approach of learning those abilities from data.
Do I need machine learning to price well?
No. Clear rules based on cost, margin targets and competitor prices work well for many shops. Machine learning helps most when there are many products, plenty of history and patterns too complex for simple rules.
How much data does a pricing model need?
There is no fixed number. The model needs enough history with real price variation to see how demand responds. Products whose price never changed give the model nothing to learn from about price response.
Related terms
In BlackAha, Smart Price helps you get a recommended selling price for every product, based on competitor and market prices.