Recall везде + фиксы окружения
- recall_macro/recall_weighted во всех скриптах с метриками (train_simple, train_gpu, autolog_demo, hyperparam_sweep, grid_search_cv, load_and_predict, compare_runs) - grid_search_cv: multi-metric scoring (accuracy + recall_macro) - register_model: выбор лучшей модели по recall (--metric) - MLflow warnings: name вместо artifact_path, сигнатура модели, numpy input_example для pytorch, подавление env-var INFO - start_ui.sh: порт 5555 + file-store backend (фикс: UI не показывал эксперименты, т.к. скрипты писали в mlruns/, а сервер читал sqlite) - setup_server.sh: развилка macOS/Linux + проверка MPS - train_gpu: get_device CUDA→MPS→CPU, num_workers=0 на macOS - AGENTS.md: гид для агента + саморегламент обновления - README/CODE_WALKTHROUGH: выровнена нумерация уроков 8/9 - .gitignore: +.DS_Store - удалён scripts/setup_git.sh
This commit is contained in:
@@ -104,6 +104,7 @@ def main():
|
||||
y_pred = model.predict(X_test)
|
||||
test_acc = accuracy_score(y_test, y_pred)
|
||||
test_recall = recall_score(y_test, y_pred, average="macro")
|
||||
test_recall_weighted = recall_score(y_test, y_pred, average="weighted")
|
||||
test_precision = precision_score(y_test, y_pred, average="macro")
|
||||
test_f1 = f1_score(y_test, y_pred, average="macro")
|
||||
|
||||
@@ -112,6 +113,7 @@ def main():
|
||||
mlflow.log_metric("cv_std_accuracy", cv_scores.std())
|
||||
mlflow.log_metric("test_accuracy", test_acc)
|
||||
mlflow.log_metric("test_recall_macro", test_recall)
|
||||
mlflow.log_metric("test_recall_weighted", test_recall_weighted)
|
||||
mlflow.log_metric("test_precision_macro", test_precision)
|
||||
mlflow.log_metric("test_f1_macro", test_f1)
|
||||
|
||||
@@ -129,7 +131,7 @@ def main():
|
||||
filled = int(bar_len * (i + 1) / len(combos))
|
||||
bar = "█" * filled + "░" * (bar_len - filled)
|
||||
print(f"\r [{bar}] {i+1}/{len(combos)} | "
|
||||
f"acc={test_acc:.4f} | {run_name[:40]:<40}", end="")
|
||||
f"acc={test_acc:.4f} rec={test_recall:.4f} | {run_name[:38]:<38}", end="")
|
||||
|
||||
print(f"\n\n{'='*60}")
|
||||
print(f"🏆 Лучший результат:")
|
||||
|
||||
Reference in New Issue
Block a user