[PYTHON] Time series data prediction by AutoML (automatic machine learning)

Here are the steps to learn a time-series predictive regression model using Azure Machine Learning's AutoML (Automatic Machine Learning).

AutoML (Automated ML) is a function that automatically performs processes such as feature engineering, model selection, and hyperparameter selection on the Azure Machine Learning side by simply inputting data and basic settings. See below for details. What is Automatic Machine Learning (AutoML)

Below is the sample code and data used in this article. : robot: Sample code (github) : beers: [Sample data (for training) --1992-2016 beer production time series data](https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/automated- machine-learning / forecasting-beer-remote / Beer_no_valid_split_train.csv) : beers: [Sample data (for testing) --2017-2018 beer production time series data](https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/automated- machine-learning / forecasting-beer-remote / Beer_no_valid_split_test.csv)

Based on the following training data (1992-2016), we will forecast the demand for beer after 2017. If you have CSV data with two columns, date and numeric data (such as sales), you can try the same procedure. image.png

Creating Azure Machine Learning

  1. Access to the Azure portal (https://ms.portal.azure.com)
  2. Press the menu in the following order
  3. [+ Create Resource] 2. [AI + Machine Learning] 3. [Machine Learning] image.png
  4. Set the following items as appropriate

Launch Azure Machine Learning Studio

From the ML screen, click [Launch Now] in Azure Machine Learning Studio (Alternatively, go to https://ml.azure.com and open the Azure Machine Learning studio screen directly) image.png

Creating a compute instance

  1. Integrated development screen Open [Computing] of Azure Machine Learning studio
  2. Select the Compute Instance tab and click + New
  3. Set the following items as appropriate

After the above settings, click the [Create] button to start deployment. image.png

Creating a training cluster

  1. Integrated development screen Open [Computing] of Azure Machine Learning studio Select the [Compute clusters] tab and click [+ New]
  2. Set the following items as appropriate

After the above settings, click the [Create] button to start deployment. image.png

Upload sample code & data

  1. From ml.azure.com, access the integrated development screen Azure Machine Learning studio.
  2. Click Notebook, click Upload Folder, and zip downloaded from github (https://github.com/yahanda/time-series-forecasting-with-auto-ml) Upload the unzipped folder. image.png

Run nodebook

  1. Click beer-forcasting-automated-ml.ipynb, then click Jupyter> Edit with Jupyter
  2. Kernel settings
  3. Specify the Python environment used by Jupyter
  4. Select Python 3.6 – AzureML
  5. Execute cell (There are 3 ways to execute cell)
  6. Shortcut: Ctrl + Enter (recommended)
  7. Select Run Cells from the Cell bar
  8. Select [> Run]

Details of what you are doing can be found in Notebook Please refer to the explanation of.

When run to the end, the best model has a very high accuracy with an average absolute error rate (MAPE) of 6.3%.

Model MAPE:
0.06370896673493383

Model Accuracy:
0.9362910332650661

It is a plot of the predicted value and the actual value.

image.png

(Check model accuracy)

You can also check the information of various models that AutoML tried from the [Automatic ML] menu of Azure Machine Learning studio via GUI.

reference

Recommended Posts

Time series data prediction by AutoML (automatic machine learning)
Machine learning Training data division and learning / prediction / verification
A story about data analysis by machine learning
Anomaly detection of time series data by LSTM (Keras)
[Python] Plot time series data
4 [/] Four Arithmetic by Machine Learning
Easy time series prediction with Prophet
Machine learning summary by Python beginners
About time series data and overfitting
Machine learning in Delemas (data acquisition)
Preprocessing in machine learning 2 Data acquisition
Differentiation of time series data (discrete)
Time series analysis 3 Preprocessing of time series data
Preprocessing in machine learning 4 Data conversion
Basic machine learning procedure: ② Prepare data
How to collect machine learning data
Judge the authenticity of posted articles by machine learning (Google Prediction API).
Forecasting time series data with Simplex Projection
Predict time series data with neural network
Making Sandwichman's Tale by Machine Learning ver4
Machine learning imbalanced data sklearn with k-NN
[Failure] Find Maki Horikita by machine learning
Python: Preprocessing in machine learning: Data acquisition
[Python] First data analysis / machine learning (Kaggle)
Time series data anomaly detection for beginners
Python: Preprocessing in machine learning: Data conversion
Python & Machine Learning Study Memo ④: Machine Learning by Backpropagation
How to handle time series data (implementation)
Preprocessing in machine learning 1 Data analysis process
Reading OpenFOAM time series data and sets data
Judgment of igneous rock by machine learning ②
Try to draw a "weather map-like front" by machine learning based on weather data (5)
Try to draw a "weather map-like front" by machine learning based on weather data (3)
Machine learning
Try to draw a "weather map-like front" by machine learning based on weather data (2)
I want to do machine learning even without a server --Time Series Edition -
Predict short-lived works of Weekly Shonen Jump by machine learning (Part 1: Data analysis)
[Machine learning] Create a machine learning model by performing transfer learning with your own data set
Machine Learning with docker (40) with anaconda (40) "Hands-On Data Science and Python Machine Learning" By Frank Kane
Get time series data from k-db.com in Python
Classification of guitar images by machine learning Part 1
Data supply tricks using deques in machine learning
Acquisition of time series data (daily) of stock prices
Notes on machine learning (updated from time to time)
[Python] Data analysis, machine learning practice (Kaggle) -Data preprocessing-
Smoothing of time series and waveform data 3 methods (smoothing)
[Python3] Let's analyze data using machine learning! (Regression)
Classify machine learning related information by topic model
View details of time series data with Remotte
Analysis of shared space usage by machine learning
Stock price forecast by machine learning Numerai Signals
[Translation] scikit-learn 0.18 Tutorial Introduction of machine learning by scikit-learn
How to read time series data in PyTorch
Reasonable price estimation of Mercari by machine learning
Classification of guitar images by machine learning Part 2
I started machine learning with Python Data preprocessing
Predicting the goal time of a full marathon with machine learning-③: Visualizing data with Python-
[Machine learning] Where will you win this year's Hakone Ekiden? ~ From data to prediction ~
Implementation of clustering k-shape method for time series data [Unsupervised learning with python Chapter 13]
Predict from various data in Python using Facebook Prophet, a time series prediction tool