Crude Oil Price Forecasting using XGBoost with on?Premise LLM Sentiment Features and LIME Explainability

Project Code :TCMAPY2463

Objective

This project developed a web?based system for predicting next?day closing prices of Brent and WTI crude oil using machine learning models, including standard XGBoost, LSTM, an XGB?LSTM hybrid, a decomposition?based CEEMDAN?VMD?CNN?BiLSTM (partial), and a sentiment?enhanced XGBoost model augmented with six LLM?generated sentiment scores obtained from a local Ollama instance (smollm:135m). The sentiment?enhanced XGBoost model achieved the best performance (RMSE 1.09 for Brent, 1.15 for WTI) and was deployed in a Flask web application with MySQL database, user authentication, LIME explanations, and optional news context input. The system demonstrates that combining numerical market data with on?premise LLM sentiment analysis improves forecast accuracy while maintaining interpretability through LIME feature?contribution plots.

Abstract

This project develops a web‑based system for forecasting crude oil prices (Brent and WTI) using XGBoost models. The system incorporates two prediction approaches: a standard model using eleven numerical features (price, volume, change percentage, calendar attributes) and a sentiment‑enhanced model that adds six LLM‑generated sentiment dimensions (geopolitical, supply/demand, economic outlook, OPEC policy, market risk, overall oil). A local Ollama instance (smollm:135m) generates sentiment scores from provided news context. LIME provides feature‑wise interpretation of predictions. The Flask backend manages user authentication, stores predictions in MySQL, and exposes REST APIs. The frontend allows users to input market data, select prediction mode, view results, and access historical forecasts. The system demonstrates improved prediction capability by combining structured numerical data with unstructured text analysis through a lightweight on‑premise language model.

 

Keywords: oil price prediction, XGBoost, sentiment analysis, LLM, LIME, Flask, MySQL, Brent crude, WTI crude, machine learning

NOTE: Without the concern of our team, please don't submit to the college. This Abstract varies based on student requirements.

Block Diagram

Specifications

4.1 SOFTWARE REQUIREMENS

 

Operating System                               :  Windows 7/8/10

Server side Script                               :  HTML, CSS, Bootstrap & JS

Programming Language                     :  Python

Libraries                                             Flask, Pandas, Torch, Sklearn, Librosa,                                                                                        Numpy , Seaborn, Matplotlib, ollama

IDE/Workbench                                  :  VSCode

Server Deployment                             :  Xampp Server

Database                                             :  MySQL    

 

4.2 HARDWARE REQUIREMENTS

 

Processor                                  - I3/Intel Processor

RAM                                       - 8GB (min)

Hard Disk                                - 128 GB

Key Board                               - Standard Windows Keyboard

Mouse                                      - Two or Three Button Mouse

Monitor                                    - Any

Demo Video

mail-banner
call-banner
contact-banner
Request Video