Machine learning models often disappoint in production for a simple reason - they have the wrong target.
Here is a quick example, and a description of our standard solution.
You are the Chief Operations Officer of a manufacturing company, and you want to improve the timing of the purchase orders for your main raw material. Here is the market price for that raw material over the past 12 months:
So should you don your « citizen data scientist » hat, jump on your favorite machine learning platform, and minimize an L1 or L2 prediction error for that price?
No so fast.
Because you are operating in real life and not in a data science lab, there is a difference between the price of that raw material on the market and its cost in your factory.
Let us assume some basic constraints to illustrate that point:
Let us also assume two simple business rules:
With this, we can generate the schedule of your purchase orders:
And we can calculate the cost of the raw material in your factory:
Our simple operational assumptions are enough to generate a discrepancy between market price and factory cost. Greater cost, constraint and business rule complexity would only amplify that (dynamic) difference.
The danger is to be so focused on price prediction accuracy that you forget it is not your real business objective.
The solution is to build an explicit representation of that business objective (the "custom loss function"), then use price predictions to minimize it.
You can’t automate that process. It is really a case of sitting down with domain experts and transposing their explanations into mathematical equations. A few guidelines from our experience:
Min Loss [Bet Amount (t) x (Price (t+1) - Price (t)) / Price (t)]
The next step - minimizing the loss function under a set of operational constraints - is challenging, and hard to achieve from scratch with open-source machine learning libraries:
Datapred’s standard work-around (built into our modeling engine) is the following:
You can then feed the combined business decision and the operational contraints you wrote down earlier to an operations research model and get the optimal business decision you were looking for.
***
This process is technically intricate, but (we think) quite intuitive. It will always result in greater operational gains than the mere targeting of a standard prediction error. It is applicable to any situation where combining predictions and constraint optimization makes sense.
***
Datapred's Continuous Intelligence engine let you build and optimize custom loss functions reflecting your true business objectives. Contact us for a discussion of these capabilities.
You can also check this page for a quick guide to Continuous Intelligence and links to interesting third-party resources on that topic.