MACHINE LEARNING RECIPES
DATA CLEANING PYTHON
DATA MUNGING
PANDAS CHEATSHEET
ALL TAGS
# Explain MA modelling of time series?

# Explain MA modelling of time series?

This recipe explains MA modelling of time series

The moving average (MA) method models the next step in the sequence as a linear function of the residual errors from a mean process at prior time steps. A moving average model is different from calculating the moving average of the time series.

So this recipe is a short example on what is MR modelling of time series. Let's get started.

```
import numpy as np
import pandas as pd
from statsmodels.tsa.arima_model import ARMA
```

Let's pause and look at these imports. Numpy and pandas are general ones. Here statsmodels.tsa.arima_model is used to import ARMA library for building of model.

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

Here, we have used one time series data from github.

Now our dataset is ready.

```
train_data = df[1:len(df)-12]
test_data = df[len(df)-12:]
```

Here we have simply split data into size of 12 and rest elements

```
model = ARMA(train_data.value, order=(0, 1))
model_fitted = model.fit()
```

We can use the ARMA class to create an MA model and setting a zeroth-order AR model. We must specify the order of the MA model in the order argument.

```
print('coefficients',model_fitted.params)
predictions = model_fitted.predict(start=len(train_data), end=len(train_data) + len(test_data)-1)
print(predictions)
```

Here, we have printed the coeffiecient of model and the predicted values.

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

Scroll down the ipython file to visualize the output.

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.

This project analyzes a dataset containing ecommerce product reviews. The goal is to use machine learning models to perform sentiment analysis on product reviews and rank them based on relevance. Reviews play a key role in product recommendation systems.

The goal of this data science project is to build a predictive model and find out the sales of each product at a given Big Mart store.

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.

In this deep learning project, you will learn to implement Unet++ models for medical image segmentation to detect and classify colorectal polyps.

Deep Learning Project- Learn to apply deep learning paradigm to forecast univariate time series data.

Machine Learning Project in R-Detect fraudulent click traffic for mobile app ads using R data science programming language.

Use the Zillow dataset to follow a test-driven approach and build a regression machine learning model to predict the price of the house based on other variables.

In this machine learning pricing project, we implement a retail price optimization algorithm using regression trees. This is one of the first steps to building a dynamic pricing model.

In this project you will use Python to implement various machine learning methods( RNN, LSTM, GRU) for fake news classification.