forecast / README.md
samim-reza's picture
Model uploaded
f828b45 verified

A newer version of the Streamlit SDK is available: 1.56.0

Upgrade
metadata
title: DataSynthis ML JobTask
emoji: πŸ“ˆ
colorFrom: blue
colorTo: green
sdk: streamlit
sdk_version: 1.28.0
app_file: app.py
pinned: false
license: mit

DataSynthis ML JobTask: Stock Price Forecasting

This application demonstrates comprehensive stock price forecasting using both traditional statistical methods (ARIMA) and modern deep learning approaches (LSTM).

🎯 Features

  • Dual Model Approach: Compare ARIMA and LSTM forecasting models
  • Interactive Interface: Upload your own stock data and get instant predictions
  • Comprehensive Analysis: Rolling window evaluation and performance metrics
  • Visual Comparisons: Professional charts and forecasting visualizations
  • Export Capabilities: Download forecast results as CSV

πŸ“Š Models Included

1. ARIMA (AutoRegressive Integrated Moving Average)

  • Traditional statistical time series model
  • Excellent for capturing linear trends and seasonality
  • Fast training and interpretable results
  • Optimal for shorter-term predictions

2. LSTM (Long Short-Term Memory)

  • Deep learning neural network architecture
  • Capable of learning complex non-linear patterns
  • Handles long-term dependencies in time series
  • Powerful for capturing market behavior nuances

πŸš€ Usage

  1. Upload Data: Upload your stock price CSV file with required columns
  2. Select Model: Choose between ARIMA, LSTM, or both models
  3. Configure: Set forecast horizon (1-60 days)
  4. Generate: Click to train models and generate predictions
  5. Analyze: View comprehensive results and download forecasts

πŸ“ Expected Data Format

Your CSV file should contain the following columns:

  • date: Date in YYYY-MM-DD format
  • open: Opening price
  • high: Highest price of the day
  • low: Lowest price of the day
  • close: Closing price
  • volume: Trading volume
  • Name: Stock symbol/company name

πŸ§ͺ Model Performance

Based on comprehensive testing with Apple (AAPL) stock data:

Model RMSE MAE MAPE (%) R-squared
ARIMA $4.99 $3.65 3.13% 0.960
LSTM $6.41 $5.00 4.23% 0.934

ARIMA showed statistically significant better performance (p < 0.05) in rolling window evaluation.

πŸ”¬ Technical Implementation

  • Rolling Window Evaluation: Robust backtesting methodology
  • Statistical Significance Testing: T-tests for model comparison
  • Comprehensive Metrics: RMSE, MAE, MAPE, Direction Accuracy, R-squared
  • Professional Visualizations: Multiple chart types for thorough analysis

πŸ› οΈ Built With

  • Streamlit: Interactive web application framework
  • Statsmodels: ARIMA implementation and statistical analysis
  • TensorFlow/Keras: LSTM neural network implementation
  • Pandas & NumPy: Data manipulation and numerical computing
  • Matplotlib & Seaborn: Data visualization
  • Scikit-learn: Machine learning utilities and metrics

πŸ“ˆ Use Cases

  • Financial Analysis: Stock price prediction and trend analysis
  • Investment Strategy: Support decision-making with quantitative forecasts
  • Risk Management: Understand model uncertainties and confidence intervals
  • Educational: Learn about different forecasting approaches
  • Research: Compare traditional vs. modern ML approaches

πŸŽ“ Key Learnings

This project demonstrates that:

  • Complexity β‰  Performance: Simpler models (ARIMA) can outperform complex ones (LSTM) for certain problems
  • Domain Knowledge Matters: Understanding time series characteristics is crucial
  • Proper Evaluation: Rolling window validation provides realistic performance estimates
  • Model Selection: Choose approaches that match your data's inherent complexity

πŸ“œ License

MIT License - feel free to use this code for your own projects!

🀝 Contributing

Contributions, issues, and feature requests are welcome! This project was created as a demonstration of comprehensive ML model comparison and deployment.


Built by DataSynthis Team - Showcasing the power of combining traditional statistics with modern machine learning for financial forecasting.