Laura Cabayol Garcia commited on
Commit
86c831d
·
1 Parent(s): d8cfd07

commit app.py with feature names

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -10,17 +10,18 @@ with open("model.pkl", "rb") as f: # Adjusted the path to model.pkl
10
  def predict(feature1, feature2, feature3, feature4, feature5):
11
  features = np.array([feature1, feature2, feature3, feature4, feature5]).reshape(1, -1)
12
  prediction = model.predict(features)
 
13
  return prediction[0]
14
 
15
  # Create the Gradio interface
16
  interface = gr.Interface(
17
  fn=predict,
18
  inputs=[
19
- gr.inputs.Number(label="Feature 1"),
20
- gr.inputs.Number(label="Feature 2"),
21
- gr.inputs.Number(label="Feature 3"),
22
- gr.inputs.Number(label="Feature 4"),
23
- gr.inputs.Number(label="Feature 5")
24
  ],
25
  outputs="text",
26
  title="Penguin Classifier"
@@ -28,5 +29,3 @@ interface = gr.Interface(
28
 
29
  if __name__ == "__main__":
30
  interface.launch()
31
-
32
-
 
10
  def predict(feature1, feature2, feature3, feature4, feature5):
11
  features = np.array([feature1, feature2, feature3, feature4, feature5]).reshape(1, -1)
12
  prediction = model.predict(features)
13
+ #add here conversion to penguin type
14
  return prediction[0]
15
 
16
  # Create the Gradio interface
17
  interface = gr.Interface(
18
  fn=predict,
19
  inputs=[
20
+ gr.inputs.Number(label="island"),
21
+ gr.inputs.Number(label="bill_length_mm"),
22
+ gr.inputs.Number(label="bill_depth_mm"),
23
+ gr.inputs.Number(label="flipper_length_mm"),
24
+ gr.inputs.Number(label="body_mass_g")
25
  ],
26
  outputs="text",
27
  title="Penguin Classifier"
 
29
 
30
  if __name__ == "__main__":
31
  interface.launch()