Code Monkey home page Code Monkey logo

time-series-analysis-tutorial's Introduction

Time Series Analysis and Forecasting

  1. Import the necessary libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

from sklearn.metrics import mean_squared_error
from math import sqrt
from statsmodels.tsa.arima_model import ARIMA
  1. Load the data, can be found here
  2. Explore the dataset
  3. Convert the date column to datetime and set as the index
  4. Plot the data for all the columns
  5. Identify Trends in Time Series
  6. Identify Seasonal Patterns in Time Series
  7. Create a separate dataframe to hold only the gym records
  8. Separate the gym dataset into training and testing data, the test data will be for the year 2017.
train = gym[gym.index.year < 2017]
test = gym[gym.index.year == 2017]
  1. Perform Forecasting on the gym dataset with each of the following methods:
    1. Method 1 – Start with a Naive Approach
    2. Method 2 – Simple average
    3. Method 3 – Moving average
    4. Method 4 – Single Exponential smoothing
  2. Plot for each method the graph showing the actual values along with the projected values.
  3. For each of the methods keep track of the RMSE to compare the performance

time-series-analysis-tutorial's People

Contributors

nick-singh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.