Be the first to read our first Ebook!

In the Age of AutoML, we are all Data Scientists! | Artificial Intelligence (AI) has become increasingly essential to our daily routine lives.

logologo

Get accurate sales forecast with AutoML in matter of a few minutes.

Published on Jul 14, 2021 by Haingomanitra H. F.

Over the past few decades, AI has found more and more applications in our world, both in businesses and in our daily lives. Not only is major research into powerful algorithms being conducted in-depth for dedicated use cases, but also the way in which people exploit and implement them in their real lives is becoming easier.

One application of AI that defies traditional methods is sales forecasting. Research indicates that, despite the significant investment of time, traditional forecasting efforts are proving ineffective. However, AI is able to leverage pools of data and identify key purchase influencers that aren’t always visible on traditional organizational charts and provide accurate sales forecasts.

But the question is: " Can we leverage AI to get sales forecasts without being an expert in data science and without spending much time?". The answer is YES!

With SmartPredict Autoflow — an automation AI system based on AutoML 2.0 — people, regardless of function, can get the most of AI in predicting future observations, such as sales in a matter of a few minutes.

This is what we will demonstrate in this article: we will forecast the daily sales of many items. To illustrate, we will forecast three online courses (MOOCs) sold on a platform. Let's discover together how this works with SmartPredict.

1- Prepare your historical sales data

The must-have for your sales forecasting project is your historical sales data. For this, you just have to gather your daily, weekly, or monthly sales history and put it in a CSV file. It probably contains dates, item ID, sales, and external factors that impact sales like promotion days. Note that all this will be taken into account by the algorithm to provide you accurate forecasts. Once your dataset is ready, you just have to import it into the SmartPredict platform.

For our illustration (the Mooc sales forecasting project), we will use the dataset in the SmartPredict platform that contains the daily sales of 3 MOOCs for 3 years. As shown in the figure below, the dataset includes promotional days and public holidays.

The MOOC course sales dataset

Now let's get down to the heart of the matter.

2- Running Autoflow to process the AI system automation

2.1- What is SmartPredict Autoflow?

Autoflow is nothing more than AI-based automation implemented in SmartPredict. So users just need to import their dataset and specify a simple basic configuration to get AI-driven forecasts. Technically speaking, it is based on AutoML 2.0 — an AI concept that aims to facilitate the completion of AI projects. Autoflow intelligently performs all AI processes automatically for you, so coding skills and data science knowledge are not necessarily required.

Let's apply it to get our AI-driven MOOCs sales forecast.

2.2- Launching Autoflow

When you get to the SmartPredict platform, click on Autoflow, import, and select your dataset. Then, you get into a screen where you can make straightforward configurations like the following :

- Target columns: the "Sales column" in this case which contains the value of the historical sales;

- Problem Type: Forecasting;

- Regressor columns: " Short_promotion and Public_holiday", columns which contain external factors that impact sales;

- Identifier columns: " Item_id", a column that is used as an identifier for the multiple items;

- Frequency: 'D' which means Day as our historical dataset contains daily sales.

Then, you can launch the Autoflow with one click.

The configuration panel before launching Autoflow

Now Autoflow makes all AI process automatically that you can follow in real-time as shown in the figure below.

Automatic processing performed by the Autoflow

The Autoflow result is presented as follows in the platform.

The result of Autoflow's search

These are the top 5 AI models, which Autoflow has trained with your dataset. You just have to select the one with the minimum error or uncertainty: for our case, we select the "Fb Prophet Forecast Model" with "0.14" uncertainty.

Note that all these AI models are the most powerful and widely used for forecasting AI projects.

Then you click on the " SAVE & RUN FLOWCHART", and Autoflow provides you the Machine Learning workflow — the flowchart— that trains your selected model as a 100% customizable flowchart. For data scientists it is a great profit as they can make modifications to the module configuration, or create their own module with Python code, to bring their expertise.

The flowchart generated by Autoflow which trains the selected model

This flowchart is 100% customizable (modifiable) and can be run at will in this drag and drop Build space.

The main steps of the AI project are done at this stage, all that remains is to put the trained model into production to provide you with the prediction.

Thus click on the Deploy and choose the option that generates deployment flowchart automatically.

The deployment flowchart which is 100% customizable and fully deployed as a Web Service

Click on the rocket icon to fully deploy it as a web service, and it's ready to provide us predictions.

Note: the Monitor space provides you the API ( kind of credential) if you want the prediction will be implemented in other IT platforms or software.

So click on Predict to move on to the Predict space.

3- Getting sales forecast in the Predict space

The Predict space is the workspace where we can send requests to get predictions directly.

It's easy: we specify the date from which we want to get the forecast, we can also specify the date there will be a promotional day or holiday and we click on the PLAY button to send it to the web service, and it returns us the Forecast.

Our request is presented as follows :

{
	
	"identifiers" : {
		"Course_ID": 11
	},
	"regressors":{
		"Short_Promotion":[
			0,
			0,
			0,
			0,
			0,
			1,
			1,
			1,
			1,
			1,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0
		],
		"Public_Holiday": [
			"Short_Promotion":[
			0,
			0,
			0,
			0,
			0,
			1,
			1,
			1,
			1,
			1,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0
		]
	},
	"start": "2020-05-31",
	"freq": "D",
	"periods": 30
}

- "identifiers" identifies the item ID to make forecasts, here the column name was Cours_ID and we want to get the forecast of the MOOC with ID 11;

- "start" indicates the day from which we get forecast;

- "freq" indicates the frequency of the future forecast;

- "periods" indicates the period to forecast, for 30 days for example;

- "regressors" indicates the external factors which are "Short_Promotion" and "Public_holiday": 1 means that the day to be forecasted will be considered as these days.

Now click on the play button to send the requests, and get predictions in a table or in chart as shown in the figure below :

The daily accurate sales forecast provided by the AI

Conclusion

We've seen how you can get accurate sales forecasts with an AI without being an expert. Now, apply these few steps with your historical sales data and get reliable forecasts in a few minutes to manage your business with confidence.

Related content video: How to get accurate sales forecasts with Autoflow?