Predicting Economic Recessions
Predicting Economic Recessions
Data Preprocessing
Time Series Sequence Creation
Train-Test Split
LSTM Model Architecture
Project Overview
• The primary goal of this project is to develop a
machine learning model using Long Short-Term
Memory (LSTM) neural networks to predict economic
recessions based on key economic indicators such as
GDP, Unemployment Rate, and Inflation.
• This project leverages time series forecasting
techniques to capture patterns and trends in
historical economic data, enabling the model to
forecast future recessions.
Objectives
• Identify the Causes of the Recession
• Assess the Economic Impact
• Understand the Social and Employment Effects
• Provide Forecasts and Future Outlook
Execution
• Importing Libraries:
import numpy as np
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import LSTM, Dense
data = pd.read_csv('economic_data.csv')
time_steps = 10
X, y = create_sequences
(scaled_features, target, time_steps)
model = Sequential()
model.add(LSTM(units=50, return_sequences=True,
input_shape=(time_steps, X_train.shape[2])))
model.add(LSTM(units=50))
model.add(Dense(1, activation='sigmoid'))
model.compile(optimizer='adam',
loss='binary_crossentropy', metrics=['accuracy'])
• Training Accuracy
• Test Accuracy
• Validation Loss
Links
• Recessions are periods of economic
contraction having a significant impact on
various industries.