Skip to content

RobCaamano/Predictive-Modeling-using-Federal-Economic-Data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Predictive Modeling using Federal Reserve Economic Data (FRED)

Sections

About

This Predictive Modeling project focuses on time series prediction of Retail Sales in the United States. Utilizing data from the Federal Reserve Economic Data (FRED), I implemented both Multi-Layer Perceptron (MLP) and Convolutional Neural Network (CNN) architectures to forecast retail sales trends.

  • Time Series Analysis: The training and testing datasets are transformed into a time series format suitable for model training and evaluation.

  • MLP and CNN Models: Two predictive models are developed using MLP and CNN architectures. These models are trained and evaluated to determine their effectiveness in forecasting retail sales.

  • Visualizations: The project includes two plots for each model:

    • Plot 1: Displays the complete history, real data, and predicted values, providing a comprehensive view of the model’s performance over the entire dataset.

    • Plot 2: Focuses on the actual data and predicted values, offering a closer look at the model's accuracy in forecasting recent trends.

  • Model Comparison: At the conclusion of the project, the performance of the MLP and CNN models is compared, highlighting their strengths and weaknesses.

Multilayer Perceptron Implementation

Hyperparameters

  • 1 Hidden Layer with 50 Neurons

  • Activation Function: Rectified Linear Unit (ReLU)

  • Loss Function: Mean Squared Error (MSE)

  • Optimizer: Adam

  • Learning Rate: 0.001

Visualizations

MLP History, Real Data & Predicted Values MLP Real Data & Predicted Values

Convolutional Neural Network Implementation

Hyperparameters

  • 1D CNN Model

  • Activation Function: Rectified Linear Unit (ReLU)

  • Filters (Feature Maps): 64

  • Kernel Size (Size of Local Patterns): 3

  • Loss Function: Mean Squared Error (MSE)

Visualizations

CNN History, Real Data & Predicted Values CNN Real Data & Predicted Values

Model Comparison

Both the Multi-Layer Perceptron (MLP) and Convolutional Neural Network (CNN) models are employed to predict retail sales. Each model operates differently and has distinct strengths and weaknesses.

  • MLP: maps input data to the desired output by learning the weights of the edges during training.

  • CNN: detects patterns in the input data by scanning through the data and learning to recognize significant patterns in the time series

Results

Overall, the results of the MLP and CNN models are similar, with both providing reasonable predictions for retail sales. However, the MLP model performs slightly better, offering more precise predictions as indicated by its lower error metrics.

Visualization