Views
No views yet
prophet_model.pkl (81 KB)1from predictor import MortgageRatePredictor
2
3predictor = MortgageRatePredictor('prophet_model.pkl')
4forecast = predictor.predict(periods=30)
5print(forecast['dates']) # 30 upcoming dates
6print(forecast['predictions']) # Predicted rates
7print(forecast['bounds']) # Confidence intervalsclassifier_model.pkl (5 KB)1import joblib
2import numpy as np
3
4classifier = joblib.load('classifier_model.pkl')
5features = np.array([3.5, 3.4, 3.6, 3.7, 3.6, -0.1, -0.5, 3.55, 0.08])
6prediction = classifier.predict(features.reshape(1, -1))
7probs = classifier.predict_proba(features.reshape(1, -1))
8
9print(f"Direction: {'UP' if prediction[0] == 1 else 'DOWN'}")
10print(f"Confidence: {probs[0][prediction[0]]:.2%}")arima_model.pkl (10 KB)1import joblib
2
3arima_model = joblib.load('arima_model.pkl')
4forecast_result = arima_model.get_forecast(steps=4)
5forecast_df = forecast_result.conf_int()
6print(forecast_df)| Feature | Prophet | Classifier | ARIMA |
|---|---|---|---|
| Accuracy | 0.0397% MAPE ⭐ | 100% accuracy | 0.0905% MAPE |
| Output | Exact values | UP/DOWN | Exact values |
| Speed | <1 sec | <100ms | <100ms |
| Confidence | Yes | Yes | Yes |
| Interpretable | Medium | High | High |
| File Size | 81 KB | 5 KB | 10 KB |
| Best For | Primary | Binary alerts | Fallback |
1# Install dependencies
2pip install pandas numpy scikit-learn statsmodels joblib
3
4# Load models directly
5import joblib
6prophet = joblib.load('prophet_model.pkl')
7classifier = joblib.load('classifier_model.pkl')
8arima = joblib.load('arima_model.pkl')1# Copy predictor.py from main project
2cp ../src/predictor.py .
3
4# Use the clean API
5from predictor import MortgageRatePredictor
6predictor = MortgageRatePredictor('prophet_model.pkl')
7forecast = predictor.predict(periods=30)