Tuesday, January 25, 2022

# A complete tutorial on Arauto for time-series analysis and modeling

Time-series analysis and modeling is one of the complex parts of data science and machine learning. An expert in time series modeling needs to perform various tests and iterate between models to get optimum results. What if by using one tool we can make this complex process very easy and understandable for beginners. This sounds like a very useful statement. So in this article, we will discuss one such tool which can make time series analysis very easy and interpretable, namely Arauto. The major points which are to be discussed in this article are listed below.

1. What is Aruto?
2. install arauto
3. Using Arauto for time-series modeling

What is Aruto?

Arauto is an open source project for time series analysis using which we can perform various analyzes on our time series data. Furthermore, we can use it to access different time series models of the ARIMA family. Some examples of models are AR, MA, ARMA, ARIMA, SARIMA, ARIMAX and SARIMAX.

We can say that Arauto is a tool that allows us to do time series analysis and modeling without writing a lot of code. By providing a smooth experience, it supports exogenous variables. Using this tool we can optimize the process from selecting a specific transformation function to testing different time series parameters. Talking about the characteristics of Arauto that can be used among time series analysis are as follows:

• It supports the independent variable, or we can say exogenous regressive.
• Using the characteristic of seasonal decomposition, we can analyze the trend, seasonality and habitat of the time series.
• It has the facility to check the stability on the time series using the Dickey-Fuller test.
• Various changes can be made to the time series such as first-order difference and seasonal log difference.
• They feature ACF and PACF plots and functions that can be used to do term estimation.
• Facility to do hyperparameter tuning using grid search technique.
• At the end of any analysis or modeling process, we can get the Python code for that process from Arto.
• One of the best features of Arauto is we can get suggestions for the process according to the data.

We can install this project on web, docker or local system. Since I am using Google Colab in this process, we will also get to know how we can make it work in Google Colab environment.

Let’s start by installing it in the Google Colab environment. At the end of the process, we will learn how we can use conda in Kolab and how we can create a python virtual environment in Kolab. Since we are using Colab, we need to mount our drive at runtime first. The below code can be used to mount the drive.

``````from google.colab import drive
drive.mount('/content/drive')``````

Output:

By clicking on the link, we will get an authorization code and using the code we mount the drive at runtime. By using below code we can install conda in Google Colab environment.

``````!pip install -q condacolab
import condacolab
condacolab.install()
``````

Output:

Let’s check out the version of conda that we got.

`!conda --version`

Output:

Let’s check the location where we have installed conda.

`!which conda`

Output:

After this installation, Konda is ready to work with the Arauto project. Let’s start the installation process of Arauto. By using below code we can clone GitHub repository in Google Drive.

`!git clone https://github.com/paulozip/arauto.git`

Output:

The code below will help us to set the clone package as our working directory.

`!cd arauto`

Let’s create a python virtual environment where we can install the Arauto project.

``````#creatring environment
!conda create --name arauto_env``````

Output:

The below code can help us to activate the environment that we have created above.

``````# activate your conda environment
%%bash
source activate arauto_env
python

import sys
print("Python version")
print (sys.version)
``````

Output:

Read Also:  LA Marathon: Jocelyn Rivas aims to be youngest to finish 100 marathons

After activation of the environment we are ready to install the project using the following lines of code:

`!pip install requirements.txt`

Output:

These are the following packages which we have in require.txt.

After installation, we are ready to use Arauto for time series analysis and modeling. By using below code we can start streamlight application.

`!streamlit run /content/arauto/run.py`

Output:

By using the link we can access the application. We can also access Aruto’s web application directly by clicking on the link.

Using Arauto for Time Series Analysis and Modeling

As we talked about its features in the introduction of Aroto. In this section, we will use some of its features so that we can build a basic understanding of how to use the Arauto project. For practicing time series analysis and modelling, we have access to the following dataset.

Whenever a time series is generated, it generates the frequency of the time and according to the series we can use the following option for the frequency.

After selecting the data and frequency we are ready for time series analysis. By scrolling down the left side panel we will get the following options.

Using these options we can select the count of data on the validation set and choose the graph as per our choice and requirement. Below are some graphs and tests created using monthly_air_passenger.csv:

historical figure

In the above graph, we can see the overall trend of the time series which is followed over the years given below.

seasonal decomposition

In the above image, we can see the different components of the time series (seasonal, trend and habitat).

acf and pacf plot

In the above plots, we can see the plots for ACF and PACF. To maintain the consistency of the data we need to make data transformations. For which we can easily select and iterate from the following options.

To force data transformation, there is an automatic feature in Aarto which already suggests the best transformation with ADF test like the following.

In the above results, we can see what is the best option for transformation. Along with this, we also get suggestions for the best model and parameter values ​​to fit the data.

Now just by choosing the forecast period and clicking the “Do Your Magic” button we can train the model on the data and get the result. The images below are the results I get from modeling using only the options suggested by Arouto.

train set prediction

test set prediction

out-of-sample forecast

The above predictions came on the Plotly dashboard and the above predictions on train and test data look like we are copying it. With it, we also get the code for the process that can be used to cross-check Aruto’s model and analysis.

To perform analysis and modeling on the self generated data we can use Aorto Rest API to send it. We can upload the data by modifying the below code as per the path of the data.

``````curl -X POST
-H 'content-type: multipart/form-data'
-F [email protected]_TO_YOUR_FILE``````

Here we have seen the implementation of time series analysis on the Arauto application.

last word

In this article, we have looked at the Arauto package and how its features can make time series analysis and modeling robust and more accurate. Since only some code is required in installation, we can say that it is a low-code tool for time series analysis. I encourage readers to use such tools to make the analysis conceptually stronger and stronger than before.

References:

World Nation News Deskhttps://www.worldnationnews.com
World Nation News is a digital news portal website. Which provides important and latest breaking news updates to our audience in an effective and efficient ways, like world’s top stories, entertainment, sports, technology and much more news.
Latest news

Related news