What is ACF in ARIMA?
MACHINE LEARNING RECIPES DATA CLEANING PYTHON DATA MUNGING PANDAS CHEATSHEET     ALL TAGS

# What is ACF in ARIMA?

This recipe explains what is ACF in ARIMA

## Recipe Objective

To calculate lag values for the Autoregression (AR) and Moving Average (MA) parameters, p and q respectively in ARIMA modelling, ACF (Autocorrelation function) is used. It is the coorelation between observation of a time series separated by k time units.

So this recipe is a short example on What is ACF in ARIMA. Let's get started.

## Step 1 - Import the library

``` import numpy as np import pandas as pd from statsmodels.graphics.tsaplots import plot_acf import matplotlib.pyplot as plt ```

Let's pause and look at these imports. Numpy and pandas are general ones. Here, plot_acf and plt will help is plotting of ACF pattern of ARIMA model.

## Step 2 - Setup the Data

``` df = pd.read_csv('https://raw.githubusercontent.com/selva86/datasets/master/a10.csv', parse_dates=['date']).set_index('date') ```

Here, we have used one time series data from github. Also, we have set our index to date.

## Step 3 - Plotting ACF

``` plt.figure() plt.subplot(211) plot_acf(df, ax=plt.gca()) plt.show() ```

We have used plot_acf to simply plot our ACF model. By observing the plot, we can have an understanding of the lag between AR and MR terms of ARIMA model.

## Step 4 - Lets look at our dataset now

Once we run the above code snippet, we will see:

```Srcoll down the ipython file to visualize the results.
```

Clearly, an exponential decay in the seasonal pattern can be seen.

#### Relevant Projects

##### Build OCR from Scratch Python using YOLO and Tesseract
In this deep learning project, you will learn how to build your custom OCR (optical character recognition) from scratch by using Google Tesseract and YOLO to read the text from any images.

##### Build an Image Classifier for Plant Species Identification
In this machine learning project, we will use binary leaf images and extracted features, including shape, margin, and texture to accurately identify plant species using different benchmark classification techniques.

##### Topic modelling using Kmeans clustering to group customer reviews
In this Kmeans clustering machine learning project, you will perform topic modelling in order to group customer reviews based on recurring patterns.

##### Human Activity Recognition Using Multiclass Classification in Python
In this human activity recognition project, we use multiclass classification machine learning techniques to analyse fitness dataset from a smartphone tracker.

##### Predict Credit Default | Give Me Some Credit Kaggle
In this data science project, you will predict borrowers chance of defaulting on credit loans by building a credit score prediction model.

##### Build a Music Recommendation Algorithm using KKBox's Dataset
Music Recommendation Project using Machine Learning - Use the KKBox dataset to predict the chances of a user listening to a song again after their very first noticeable listening event.

##### Natural language processing Chatbot application using NLTK for text classification
In this NLP AI application, we build the core conversational engine for a chatbot. We use the popular NLTK text classification library to achieve this.

##### Churn Prediction in Telecom using Machine Learning in R
Estimating churners before they discontinue using a product or service is extremely important. In this ML project, you will develop a churn prediction model in telecom to predict customers who are most likely subject to churn.

##### Forecasting Business KPI's with Tensorflow and Python
In this machine learning project, you will use the video clip of an IPL match played between CSK and RCB to forecast key performance indicators like the number of appearances of a brand logo, the frames, and the shortest and longest area percentage in the video.

##### Ola Bike Rides Request Demand Forecast
Given big data at taxi service (ride-hailing) i.e. OLA, you will learn multi-step time series forecasting and clustering with Mini-Batch K-means Algorithm on geospatial data to predict future ride requests for a particular region at a given time.