As you know,lots of companies,related to logistics system,are having troubles with managing their finances,when it comes to transporting and ordering.There are tons of problems and unnecessary costs,that are driving executives crazy.But the main problem,that is causing the most biggest pain to these companies,IS Transportation Expenses.Just imagine how much billions(if not trillions) dollars would be saved IF all transportation expenses had been minimized.Minimized expenses are main keys for preventing corrupcy among workers and increasing profits of company.
Kaufland has challenged us to reduce the unnecessary expenses on product transportation. The reinforcement learning algorithms are great at adapting in dynamically changing environment. It also can find such solutions to problems that human intellect would not consider. Our environment is the customer demand and the question is ‘How can we satisfy customer’s demand with lowest possible cost?’. The costs come from:
The solution to this problem won’t only be beneficial for business but also costumers since products can be shipped according to priority of item at this particular hypermarket.
For such task we’ll use Python and our model is RandomForest.
So,how to handle this?How to minimize transportation expenses?What should we do?Okey,before rushing,just let us show some interesting data visualizations and information,that can solve this “nightmare” of CEOs of logistics companies.
Firstly,we have to substitute commas in columns “item_prio” and “storage_cost” with dots.It will give us the ability to manipulate with these numbers as floats,not as strings.
(code in the image above)
Secondly,we are removing “item_id” and “item_name” from data,because they are useless(we can know the popularity of one type of item through vizualisation the item_id and order_qty,but there has almost been given the priority of each product).
Thirdly,we create dummy variables for column “Unit”.Because storage_cost,min_stock,max_stock,transport_qty and order_qty are dependent on ST and KG units(1 ST=6.35 KG,so instead of multipltiying,it is better to create separate new binary column “ST”).Of course,after this.column “Unit” will be dropped,because we dont need it anymore.
Now data is ready for manipulations.
We decided to use RandomForest,one of the best methods for predicting this type of tasks.
The difference between actual and predicted values is really small,and we can put it in production.