0% found this document useful (0 votes)
45 views70 pages

VARMA For Battery Voltage Forecasting 1

This document provides an introduction to forecasting using VARMA and LSTM with Python. It discusses brief introductions to forecasting, VARMA, LSTM and Python. It then covers installing Python and Anaconda, and getting started with coding in a Jupyter notebook. It includes an in-depth section on working with NumPy and Pandas, covering creating and manipulating arrays and dataframes. The goal is to equip the reader with the basics needed to begin coding for forecasting in Python.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views70 pages

VARMA For Battery Voltage Forecasting 1

This document provides an introduction to forecasting using VARMA and LSTM with Python. It discusses brief introductions to forecasting, VARMA, LSTM and Python. It then covers installing Python and Anaconda, and getting started with coding in a Jupyter notebook. It includes an in-depth section on working with NumPy and Pandas, covering creating and manipulating arrays and dataframes. The goal is to equip the reader with the basics needed to begin coding for forecasting in Python.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 70

Introduction to forecasting using VARMA and

LSTM with python

1. Brief introduction to forecasting


2. Brief introduction to VARMA
3. Brief introduction to LSTM
4. Brief introduction to python
5. Installation of python (using PC)
6. Start coding!
Brief introduction to forecasting

Forecasting
-the prediction of the future using the
information from the historical data.
Brief introduction to forecasting
Application of forecasting

1. Weather forecasting
Brief introduction to forecasting
Application of forecasting

2. Currency exchange rate forecasting


Brief introduction to forecasting
Application of forecasting

3. Electricity load profile forecasting


Brief introduction to forecasting
Application of forecasting

4. Political forecasting
Brief introduction to forecasting
Application of forecasting

5. Sales forecasting
Brief introduction to forecasting

Types of forecasting methods

Machine learning
Statistical method
method
Brief introduction to VARMA

Vector Autoregressive Moving Average


-a tool that forecasts the next step in
each time series using the past values of
the same time series and other correlated
time series
Brief introduction to LSTM

Long-short Term Memory


a flexible computing framework, used
to model nonlinear systems
a type of recurrent neural network
(RNN), which is capable of learning
long-term dependencies
Brief introduction to python
Python

 A general-purpose high-level programming language


 Its design philosophy emphasizes programmer productivity and
code readability.
Brief introduction to python

  a free and open-source distribution of the Python and R


programming languages for scientific computing, that aims to
simplify package management and deployment. 
Brief introduction to python
notebook

 an open-source web application that allows you to create and


share documents that contain live code, equations, visualizations
and narrative text.
 Uses include: data cleaning and transformation, numerical
simulation, statistical modeling, data visualization, machine
learning, and much more. 
Installation
1. Download Anaconda distribution
 Go to www.anaconda.com.
Installation
1. Download Anaconda distribution
 Click download.
Installation
1. Download Anaconda distribution
 Click download, again.
Installation
1. Download Anaconda distribution
 Choose OS.
Installation
1. Download Anaconda distribution
 Download Python 3.7 version.
Installation
2. Install Anaconda distribution
 Open installer, click next.
Installation
2. Install Anaconda distribution
 Agree.
Installation
2. Install Anaconda distribution
 Choose installation type, click next.
Installation
2. Install Anaconda distribution
 Choose installation folder, click next.
Installation
2. Install Anaconda distribution
 Click install.
Installation
2. Install Anaconda distribution
 After installation, click next.
Installation
2. Install Anaconda distribution
 Click next.
Installation
2. Install Anaconda distribution
 Finish installation.
Installation
3. Install Jupyter Notebook
 Open Anaconda Navigator.
Installation
3. Install Jupyter Notebook
 Launch Jupyter notebook.
Installation
3. Install Jupyter Notebook
 If not yet installed, just click install.
Get started
1. Create new Jupyter Notebook file. (.ipynb)
 Click New.
Get started
1. Create new Jupyter Notebook file. (.ipynb)
 Click Python 3.
Get started
2. Get familiar.

File name
Menu bar tools

Input cell
Output cell
Get started
3. Useful shortcuts
 Execute code (Shift + Enter)

 Navigate between cells ( arrow, arrow)


 Delete cell (Shift + Enter)
Get started
4. Useful libraries
 NumPy
 Pandas
 SciPy
 SciKit-Learn
 Matplotlib
 Seaborn
Get started
4.1 NumPy
Importing the NumPy module
1

2
Get started
4.1 NumPy
Array creation

np.array converts numerical data arranged in an array-like structure to array


np.zeros create an array filled with 0 values with the specified shape.
np.arange create arrays with regularly incrementing values.
np.linspace create arrays with a specified number of elements, and spaced equally between
the specified beginning and end values.
np.indices create a set of arrays (stacked as a one-higher dimensioned array), one per
dimension with each representing variation in that dimension.
Get started
4.1 NumPy
Array creation (example)
np.array
Get started
4.1 NumPy
Array creation (example)
np.zeros
Get started
4.1 NumPy
Array creation (example)
np.arange
Get started
4.1 NumPy
Array creation (example)
np.linspace
Get started
4.1 NumPy
Array creation (example)
np.indices
Get started
4.1 NumPy
Printing arrays

>>>print( )
Get started
4.1 NumPy
Printing arrays
TASK: Create array a with values from 0 to 6.
Get started
4.1 NumPy
Printing arrays
TASK: Create array a with values from 0 to 6.
Get started
4.1 NumPy
Printing arrays
TASK: Print array a.
Get started
4.1 NumPy
Printing arrays
TASK: Print array a.
Get started
4.1 NumPy
NumPy attributes

attributes Description
ndarray.ndim the number of axes (dimensions) of the
array.
ndarray.shape the dimensions of the array.
ndarray.size the total number of elements of the
array.
ndarray.dtype an object describing the type of the
elements in the array.
Get started
4.1 NumPy
Example
Create array a with values from 0 to 15 and shape 3 by 5.
Get started
4.1 NumPy
Example
 ndarray.ndim
Get started
4.1 NumPy
Example
 ndarray.shape
Get started
4.1 NumPy
Example
 ndarray.size
Get started
4.1 NumPy
Example
 ndarray.dtype
Get started
4.1 NumPy
Exercises
1. Write a NumPy program to create an element-wise
comparison (greater, greater_equal, less and
less_equal) of two given arrays.
2. Write a NumPy program to create an array with the
values 1, 7, 13, 105 and determine the size of the
memory occupied by the array.
Get started
4.1 NumPy
Exercises
1. Write a NumPy program to create an element-wise
comparison (greater, greater_equal, less and less_equal)
of two given arrays.
2. Write a NumPy program to create an array with the
values 1, 7, 13, 105 and determine the size of the
memory occupied by the array.
3. Write a NumPy program to create a 3x3 identity matrix,
i.e. diagonal elements are 1, the rest are 0.
Get started
4.1 NumPy
Solution
1.
Get started
4.1 NumPy
Solution
2.
Get started
4.1 NumPy
Solution
3.
Get started
4.2 Pandas
Importing the Pandas module
1

2
Get started
4.2 Pandas
DataFrame creation

1. Create DataFrame
2. Convert data to a DataFrame type
3. Read data from a file
Get started
4.2 Pandas
DataFrame creation
1. Create DataFrame
Get started
4.2 Pandas
DataFrame creation
1. Create DataFrame
TASK: Create DataFrame df with three columns.
Column1: 0, 1, 2, 3, 4
Column2: 5, 6, 7, 8, 9
Column3: 10, 11, 12, 13, 14
Get started
4.2 Pandas
DataFrame creation
1. Create DataFrame
TASK: Create DataFrame df with three columns.
Column1: 0, 1, 2, 3, 4
Column2: 5, 6, 7, 8, 9
Column3: 10, 11, 12, 13, 14
Get started
4.2 Pandas
DataFrame creation
1. Create DataFrame
Get started
4.2 Pandas
DataFrame creation
1. Create DataFrame
using attribute “.T” transpose the DataFrame df.
Get started
4.2 Pandas
DataFrame creation
1. Create DataFrame
DataFrame vs. Array

Array DataFrame
Get started
4.2 Pandas
DataFrame creation
2. Read data from a file

>>>pd.read_csv()
Get started
4.2 Pandas
DataFrame creation
3. Convert array to DataFrame
>>> pd.DataFrame(array)
Get started
4.3 How to be familiar with other libraries
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html
Get started
4.3 How to be familiar with other libraries
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html
Get started
4.3 How to be familiar with other libraries
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html

You might also like