π± FXTimeSeries - Exchange Rate Forecasting
This project provides a complete pipeline for forecasting foreign exchange (FX) rates using machine learning. It includes data preprocessing, feature engineering, model training with hyperparameter tuning, and deployment via a Streamlit web application.
π¦ Features
- β Full ML pipeline: ETL, feature engineering, model training, evaluation
- π§ Trained models: Random Forest, XGBoost, SVR
- π Time series techniques: lag features, rolling stats, date-based features
- π§ͺ Model selection using GridSearchCV
- π Evaluation metrics: RMSE, MAE, RΒ²
- π Streamlit app for predictions on new data
- πΎ Models available as split ZIP archive
π Repository Structure
FXTimeSeries/ βββ app.py # Streamlit application βββ exchange_rate_pipeline.py # Complete training pipeline βββ models_split.zip # Main model zip file (part of archive) βββ models_split.z01-z07 # Split model zip parts βββ requirements.txt # Python dependencies βββ README.md # This file βββ modelcard.json # Hugging Face model card
π§ Models Trained
| Model | Description |
|---|---|
| Random Forest Regressor | Ensemble model using decision trees |
| XGBoost Regressor | Gradient boosting algorithm |
| Support Vector Regressor | Kernel-based regression model |
Each model was optimized using GridSearchCV over parameters like n_estimators, max_depth, C, kernel, and learning_rate.
π§ͺ Evaluation Metrics
Evaluation was done on a test set using:
- RMSE (Root Mean Squared Error)
- MAE (Mean Absolute Error)
- RΒ² Score
The best models from grid search were saved and exported.
π Running the App
1. Install Dependencies
pip install -r requirements.txt
2. Start the Streamlit App
bash
Copy
Edit
streamlit run app.py
3. Upload CSV File
Upload a preprocessed CSV that contains the same features used during training.
π₯ Downloading the Models
The model files are provided as a multi-part split archive:
models_split.zip
models_split.z01
models_split.z02
...
models_split.z07
To extract:
On Linux/macOS:
bash
Copy
Edit
cat models_split.z* models_split.zip > combined_models.zip
unzip combined_models.zip
On Windows:
Use 7-Zip or WinRAR to extract starting from models_split.zip.
π License
This project is licensed under the MIT License.
πββοΈ Author
Voltsy
GitHub: @heubert-69
## π `modelcard.json`
```json
{
"model_name": "FXTimeSeries",
"license": "mit",
"language": "en",
"tags": ["time-series", "regression", "exchange-rate", "finance", "streamlit"],
"datasets": ["custom"],
"metrics": ["rmse", "mae", "r2"],
"model-index": [
{
"name": "FXTimeSeries",
"results": [
{
"task": {
"name": "Time Series Forecasting",
"type": "time-series-forecasting"
},
"metrics": [
{
"name": "RMSE",
"type": "rmse",
"value": "See README"
},
{
"name": "MAE",
"type": "mae",
"value": "See README"
},
{
"name": "RΒ²",
"type": "r2",
"value": "See README"
}
]
}
]
}
],
"widget": {
"type": "table",
"inputs": "CSV file with the same feature columns used in training"
},
"pipeline_tag": "time-series-forecasting",
"library_name": "sklearn"
}