Skip to content

Repository files navigation

Python TensorFlow XGBoost Optuna

Stock Price Forecasting and Analysis System

A comprehensive stock market analysis and forecasting project developed as part of a research-oriented capstone study. The project focuses on collecting historical stock data, preprocessing financial time series, applying multiple forecasting techniques, and evaluating model performance.

Overview

This repository contains tools and models for:

  • Historical stock market data collection
  • Data preprocessing and feature engineering
  • Time series forecasting
  • Machine Learning and Deep Learning based prediction
  • Hyperparameter optimization
  • Data visualization and business intelligence reporting

The project evaluates different forecasting approaches and compares their performance on stock price prediction tasks.


Project Structure

Capstone-Project/
│
├── business_intelligence.py
│
├── isyatirim_script/
│   ├── HistoricalData.py
│   ├── Execution.py
│   └── Endeks.xlsx
│
├── isyatirim_script_yfinance_entegration/
│   ├── HistoricalData.py
│   ├── Execution.py
│   └── Endeks.xlsx
│
└── model/
    ├── Auto_Arima.py
    ├── GridSearchCV.py
    ├── Stock_Price_Forecasting_With_LSTM.py
    ├── Tree_Structured_Parzen_Estimator.py
    └── tspe_with_optuna.py

Features

Data Collection

  • Historical stock data retrieval
  • Integration with Yahoo Finance
  • Automated dataset generation
  • Support for BIST (Borsa Istanbul) stocks

Forecasting Models

Auto ARIMA

Statistical time-series forecasting using the Auto ARIMA approach.

LSTM Neural Network

Deep learning-based forecasting using Long Short-Term Memory (LSTM) networks.

XGBoost with Grid Search

Machine learning model optimized through exhaustive hyperparameter tuning.

TPE Optimization

Tree-Structured Parzen Estimator (TPE) based hyperparameter optimization.

Optuna Optimization

Advanced Bayesian optimization using Optuna.

Visualization

  • Stock closing price visualization
  • Trend analysis
  • Historical performance monitoring

Technologies Used

  • Python
  • Pandas
  • NumPy
  • Matplotlib
  • Seaborn
  • Scikit-Learn
  • XGBoost
  • TensorFlow / Keras
  • Optuna
  • pmdarima
  • yfinance

Installation

Clone the repository:

git clone https://github.com/condor-k/Capstone-Project.git
cd Capstone-Project

Install dependencies:

pip install -r requirements.txt

If a requirements file is not available, install the necessary libraries manually.


Usage

1. Collect Historical Data

Run the data collection scripts:

python isyatirim_script/Execution.py

or

python isyatirim_script_yfinance_entegration/Execution.py

2. Train Forecasting Models

Auto ARIMA:

python model/Auto_Arima.py

LSTM:

python model/Stock_Price_Forecasting_With_LSTM.py

Grid Search Optimization:

python model/GridSearchCV.py

Optuna Optimization:

python model/tspe_with_optuna.py

3. Visualize Data

Generate stock price charts:

python business_intelligence.py

Example:

visualize_data("HEKTS")

Research Objectives

The primary goals of this project are:

  • Collect and manage financial market data
  • Compare statistical, machine learning, and deep learning forecasting methods
  • Evaluate prediction accuracy across different models
  • Investigate optimization techniques for improving model performance
  • Support investment analysis through data-driven insights

Future Improvements

  • Real-time stock data streaming
  • Interactive dashboard development
  • Automated model comparison reports
  • Ensemble forecasting methods
  • Web-based prediction platform
  • Docker deployment support

Disclaimer

This project is intended for academic and research purposes only.

The predictions generated by the models should not be considered financial advice. Investment decisions should be made using comprehensive market analysis and professional consultation.


License

This project is currently not distributed under a specific license. Feel free to add an appropriate license if you plan to make the repository publicly reusable.

About

TÜBİTAK 2209-A Capstone Project

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages