-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
25 lines (18 loc) · 839 Bytes
/
main.py
File metadata and controls
25 lines (18 loc) · 839 Bytes
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
import warnings
warnings.filterwarnings("ignore")
from src.data.loader import load_data
from src.modeling.train import train_and_compare_models
from src.modeling.evaluate import evaluate_model
from src.visualization.plots import plot_feature_importance
from src.config import MODEL_DIR
def main():
print("=== Student Placement Prediction ===")
df = load_data()
results_df, best = train_and_compare_models(df)
if best["Model"] in ["RandomForest", "XGBoost"]:
plot_feature_importance(best["Pipeline"], save_path=MODEL_DIR / "feature_importance.png")
best_model_path = MODEL_DIR / f"{best['Model']}_pipeline.pkl"
metrics = evaluate_model(df, model_path=best_model_path)
print("\n✅ Training complete! Check 'models/' for saved artifacts.")
if __name__ == "__main__":
main()