-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (34 loc) · 1.23 KB
/
Copy pathMakefile
File metadata and controls
43 lines (34 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
.PHONY: setup generate train register mlflow-ui api test clean
setup:
python3 -m venv venv && \
venv/bin/pip install --upgrade pip && \
venv/bin/pip install -r requirements.txt
@echo "Setup complete — microlend-recommender ready"
generate:
venv/bin/python src/data/synthetic_generator.py
train:
venv/bin/python src/pipeline.py
register:
venv/bin/python -c "\
import yaml; \
from src.tracking import setup_mlflow, set_production, list_registered_models; \
config = yaml.safe_load(open('configs/config.yaml')); \
setup_mlflow(config); \
model_name = config['mlflow']['registry']['model_name']; \
promoted = set_production(model_name, metric='rmse'); \
[print(r) for r in list_registered_models()]; \
"
mlflow-ui:
venv/bin/mlflow ui --backend-store-uri sqlite:///mlflow.db --port 5000
ui:
PYTHONPATH=. venv/bin/uvicorn api.main:app --reload --host 0.0.0.0 --port 8000
api:
PYTHONPATH=. venv/bin/uvicorn api.main:app --reload --host 0.0.0.0 --port 8000
test:
venv/bin/pytest tests/ -v
clean:
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -name "*.pyc" -delete 2>/dev/null || true
find . -name "*.pyo" -delete 2>/dev/null || true
rm -rf .pytest_cache 2>/dev/null || true
@echo "Cleaned build artifacts"