Spaces:
Build error
A newer version of the Streamlit SDK is available: 1.56.0
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
- Upload Data: Upload your stock price CSV file with required columns
- Select Model: Choose between ARIMA, LSTM, or both models
- Configure: Set forecast horizon (1-60 days)
- Generate: Click to train models and generate predictions
- Analyze: View comprehensive results and download forecasts
π Expected Data Format
Your CSV file should contain the following columns:
date: Date in YYYY-MM-DD formatopen: Opening pricehigh: Highest price of the daylow: Lowest price of the dayclose: Closing pricevolume: Trading volumeName: 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.