Onepagecode

Onepagecode

Implementing Stock Market Prediction: NeuralProphet + DNN (PyTorch Guide & Critique)

A step-by-step PyTorch implementation of the NP-DNN hybrid model (arXiv:2601.05202v3), resolving dataset contradictions with Optuna.

Onepagecode's avatar
Onepagecode
Jul 14, 2026
∙ Paid

Use the URL at the end of this to download source code

The paper proposes a hybrid model (NP-DNN) combining Neural Prophet and Deep Neural Network for stock market price prediction. The methodology includes data preprocessing (Z-score normalization, missing value imputation via linear interpolation), feature extraction using MLP, prediction using DNN, and hyperparameter tuning with Optuna. The model is evaluated on the Crunchbase dataset using classification metrics (accuracy, precision, recall, F1) and compared with DSS, LightGBM, RF, and LLM, claiming 93.21% accuracy. The paper contains several inconsistencies and ambiguities, including a mismatch between the dataset (startup investments) and the task (stock price prediction), and inappropriate use of classification metrics.

Implementation Assumptions

  • The task is binary classification (price up/down) to align with classification metrics.

  • MLP has 2 hidden layers (64, 32) with ReLU; DNN has 2 hidden layers (64, 32) with ReLU and softmax output.

  • Neural Prophet is implemented using the Prophet library (not neuralprophet) for simplicity.

  • Optuna search space: learning rate [1e-5, 1e-1], number of layers [1,3], hidden units [32,256], dropout [0.0,0.5], batch size [16,128].

  • The Crunchbase dataset is not used; synthetic data is generated for demonstration.

  • The abstract accuracy 99.21% is a typo; we use 93.21% as the claimed accuracy.

Introduction and Paper Overview

Stock market price prediction is one of the most challenging problems in financial forecasting. Prices move in response to countless factors—economic news, investor sentiment, geopolitical events, and random noise—making it nearly impossible to predict with high accuracy using simple methods. Traditional statistical models like ARIMA or linear regression often fail to capture the complex, nonlinear patterns that drive market movements.

The paper we are implementing, "Stock Market Price Prediction using Neural Prophet with Deep Neural Network" (arXiv:2601.05202v3), proposes a hybrid model called NP-DNN that combines two powerful tools:

  • Neural Prophet (NP): A time series decomposition model that breaks a price history into interpretable components: the overall trend, repeating seasonal patterns, holiday effects, and random error. This helps the model understand long-term structure.

  • Deep Neural Network (DNN): A multi-layer neural network that learns complex patterns from data. The paper uses a Multi-Layer Perceptron (MLP) for feature extraction before feeding into the DNN for final prediction.

The overall pipeline has three main stages:

  1. Data Preprocessing: Fill missing values using linear interpolation and standardize features with Z-score normalization.

  2. Feature Extraction: Use an MLP to transform the preprocessed data into a more informative representation.

  3. Prediction: Feed the extracted features into a DNN with a softmax output layer to produce a classification (e.g., price up or down).

The paper claims that this NP-DNN model achieves 93.21% accuracy on the Crunchbase dataset, outperforming methods like LightGBM, Random Forest, and even a Large Language Model (LLM).

What to Expect from This Tutorial

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2026 Onepagecode · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture