Skip to content

Panzer3232/Time-Series-Lstm

Repository files navigation

Time-Series Analysis for Rainfall Data using LSTM Model

Pipeline For the Project

1) Data Preprocessing

a) All necessary libraries are imported for data manipulation, model creation and visualization.
b) CSV data is loaded and "Year" column is dropped and dataset is split into training and testing sets.
c) Normalization of dataset is done to scale data between 0 and 1 using MinMaxScalar.
d) Input and target sequences for LSTM model is created.

2) Creation of LSTM Model

a) LSTM based neural network, that takes input size (number of features), hidden size of LSTM units, number of output features.
b) Model contains a LSTM layer and Linear Fully connected layer.
c) Forward function process the input and produce the output.

3) Train the Neural Network

a) Train the model using train_test.py script
b) The train_model() prints the loss at every 10th epoch.
c) Model uses the Mean Squared error as the loss function and also uses Adam optimizer

4) Evaluate the Neural Network

a) LSTM model is tested on the given test input and predicts the outputs

5) Visualization of Results

a) Plot of actual and predicted values for Rainfall focusing on the last month of the sequence.

Run the Code

Use the below command to run the scripts
python train_test.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published