Skip to content

Latest commit

 

History

History
224 lines (165 loc) · 4.63 KB

File metadata and controls

224 lines (165 loc) · 4.63 KB

Quick Start Guide

This is a quick reference guide for common tasks in the Financial Time Series Forecasting project.

Installation

# Clone the repository
git clone https://github.com/yourusername/financial-ts-forecasting.git
cd financial-ts-forecasting

# Install dependencies
pip install -r requirements.txt

# Or install as a package
pip install -e .

Running the Application

Option 1: Python Script

python run_project.py

Option 2: Windows Batch File

run_streamlit.bat

Option 3: PowerShell Script

.\run_streamlit.ps1

The application will open in your browser at http://localhost:8501

Training Models

Single Model Training

python train.py

Train All Tickers

python train_all_tickers.py

Train Bayesian Neural Network

python train_bnn.py

Model Evaluation

Evaluate Trained Models

python evaluate.py

Run Backtesting

python backtest.py

Hyperparameter Optimization

python hparam_search.py

This will run an Optuna study to find optimal hyperparameters.

Generate Documentation Figures

# Generate all figures
python utils/generate_figures.py

# Generate HPO table
python utils/generate_hpo_table.py

# Generate technical indicators table
python utils/generate_indicators_table.py

Configuration

All configuration files are in the configs/ directory:

  • baseline_lstm.yaml - LSTM baseline configuration
  • mc_dropout.yaml - MC Dropout configuration
  • bnn_pyro.yaml - Bayesian Neural Network configuration
  • transformer.yaml - Transformer configuration
  • train_config.yaml - Training parameters

Edit these files to customize model behavior.

Data

Fetch New Data

python scripts/fetch_data.py

Prepare Dataset

python scripts/make_dataset.py

Data is stored in the data/ directory.

Testing

# Run all tests
python -m pytest tests/ -v

# Run with coverage
python -m pytest tests/ -v --cov=src --cov-report=html

# Run specific test file
python -m pytest tests/test_models.py -v

Code Quality

Format Code

black src/ tests/ utils/ --line-length=100
isort src/ tests/ utils/ --profile black

Lint Code

flake8 src/ tests/ --max-line-length=100
mypy src/ --ignore-missing-imports

Docker

Build Docker Image

docker build -t financial-ts-forecasting .

Run Docker Container

docker run -p 8501:8501 financial-ts-forecasting

Project Structure

ML-Intern/
├── app/                  # Streamlit application
├── configs/              # Configuration files
├── data/                 # Data storage
├── reports/              # Documentation & figures
├── scripts/              # Utility scripts
├── src/                  # Source code
├── tests/                # Unit tests
├── utils/                # Project utilities
├── train.py              # Training script
├── evaluate.py           # Evaluation script
└── run_project.py        # Main runner

Common Issues

Issue: Missing Dependencies

Solution: Run pip install -r requirements.txt

Issue: CUDA Out of Memory

Solution: Reduce batch size in configs/train_config.yaml

Issue: Data Not Found

Solution: Run python scripts/fetch_data.py to download data

Issue: Streamlit Port Already in Use

Solution: Kill the process or change port:

streamlit run app/streamlit_app.py --server.port 8502

Documentation

Support

For issues, questions, or contributions:

Author: Mohansree Vijayakumar
Email: mohansreesk14@gmail.com

  1. Check the documentation
  2. Review CONTRIBUTING.md for guidelines
  3. Open an issue on GitHub

Version: 1.0.0
Last Updated: 2025-10-14 | Run app | python run_project.py | | Train model | python train.py | | Evaluate | python evaluate.py | | Backtest | python backtest.py | | HPO | python hparam_search.py | | Test | pytest tests/ -v | | Format | black src/ --line-length=100 | | Lint | flake8 src/ --max-line-length=100 |


Version: 1.0.0
Last Updated: 2025-10-14