Using Madjik API for ML
Overview
ML Use Cases
1. Price Prediction Models
import pandas as pd
from sklearn.ensemble import RandomForestRegressor
# Fetch historical features
def get_training_data(days=90):
features = ["ME10014", "ME10015", "ME10016", "ME10030"]
data = []
for metric in features:
resp = requests.get(
f"https://api.madjik.io/v1/metrics/{metric.lower()}/history",
params={"days": days},
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
data.append(pd.DataFrame(resp.json()['data']))
return pd.concat(data, axis=1)
# Train model
X = get_training_data()
y = get_price_returns() # Your price data
model = RandomForestRegressor()
model.fit(X, y)2. Regime Classification
3. Anomaly Detection
Feature Engineering Tips
Madjik Metric
ML Feature Ideas
Best Practices
See Also
Last updated