arnie23 commited on
Commit
ffafa92
·
verified ·
1 Parent(s): 05369b7

Upload model (1).py

Browse files
Files changed (1) hide show
  1. model (1).py +15 -0
model (1).py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # model.py
2
+ import numpy as np
3
+ from geo_metals_model_fixed import model # Import the reconstructed model pipeline
4
+
5
+ def predict_metals(input_df):
6
+ preds = model.predict(input_df)[0]
7
+ preds = np.clip(preds, 0, None) # Ensure no negative concentrations
8
+ return {
9
+ "Fe_ppm": preds[0],
10
+ "Cr_ppm": preds[1],
11
+ "Mn_ppm": preds[2],
12
+ "Mo_ppm": preds[3],
13
+ "In_ppm": preds[4],
14
+ "Ta_ppm": preds[5],
15
+ }