Views
No views yet
1import mlflow
2import pandas as pd
3
4# Load the model
5model_uri = "models:/market_regime_classifier/Production"
6model = mlflow.xgboost.load_model(model_uri)
7
8# Prepare features
9features = pd.DataFrame([{
10 'india_vix': 15.5,
11 'rsi_14': 55.3,
12 'ma_50': 18500.25,
13 'ma_200': 18200.75
14}])
15
16# Predict
17prediction = model.predict(features)[0]
18proba = model.predict_proba(features)[0]
19
20regime = "RISK_ON" if prediction == 1 else "RISK_OFF"
21confidence = proba[prediction]
22
23print(f"Regime: {regime} (confidence: {confidence:.2%})")1curl -X POST "https://AAdevloper-mlops-finance-pipeline.hf.space/predict_regime" \
2 -H "Content-Type: application/json" \
3 -d '{
4 "india_vix": 15.5,
5 "rsi_14": 55.3,
6 "ma_50": 18500.25,
7 "ma_200": 18200.75
8 }'1model:
2 type: xgboost
3 params:
4 max_depth: 6
5 learning_rate: 0.1
6 n_estimators: 100
7 objective: binary:logistic
8 eval_metric: logloss