| # model.py | |
| def predict_metals(input_df): | |
| import joblib | |
| # Load the trained model | |
| model = joblib.load("geo_metals_model_fixed.joblib") | |
| # Predict using the model | |
| preds = model.predict(input_df)[0] | |
| # Return results with expected keys | |
| return { | |
| "Fe_ppm": preds[0], | |
| "Cr_ppm": preds[1], | |
| "Mn_ppm": preds[2], | |
| "Mo_ppm": preds[3], | |
| "In_ppm": preds[4], | |
| "Ta_ppm": preds[5], | |
| } | |