Hemg commited on
Commit
444d61e
·
verified ·
1 Parent(s): 81fa7c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -1,4 +1,4 @@
1
- import gradio as gr
2
  import joblib
3
  import numpy as np
4
  import pandas as pd
@@ -76,6 +76,12 @@ def predict_performance(Location, Course, Faculty, College, Source, Event, Prese
76
  print("\nDataFrame after encoding:")
77
  print(df)
78
 
 
 
 
 
 
 
79
  # Scale input data using the loaded scaler
80
  scaled_input = scaler.transform(df)
81
 
@@ -110,6 +116,7 @@ iface = gr.Interface(
110
  gr.Radio(["Ram", "Gita", "Manish", "Shyam", "Raj", "Hari", "Rina", "Shree"],
111
  label="Presenter"),
112
  gr.Radio(["Yes", "No"], label="Visited Parent"),
 
113
  gr.Radio(["Yes", "No"], label="Visited College for Inquiry"),
114
  gr.Radio(["Yes", "No"], label="Attended Any Event"),
115
  gr.Number(label="College Fee"),
 
1
+ mport gradio as gr
2
  import joblib
3
  import numpy as np
4
  import pandas as pd
 
76
  print("\nDataFrame after encoding:")
77
  print(df)
78
 
79
+ # Ensure the DataFrame columns match the order used during scaler fitting
80
+ expected_columns = ["Location", "Course", "Faculty", "College", "Source", "Event",
81
+ "Presenter", "Visited Parent", "Visited College for Inquiry",
82
+ "Attended Any Event", "College Fee", "GPA", "Year"]
83
+ df = df[expected_columns]
84
+
85
  # Scale input data using the loaded scaler
86
  scaled_input = scaler.transform(df)
87
 
 
116
  gr.Radio(["Ram", "Gita", "Manish", "Shyam", "Raj", "Hari", "Rina", "Shree"],
117
  label="Presenter"),
118
  gr.Radio(["Yes", "No"], label="Visited Parent"),
119
+ gr.Radio(["Trinity", "CCRC", "KMC", "SOS", "ISMT", "St. Xavier's", "Everest", "Prime"], label="College"),
120
  gr.Radio(["Yes", "No"], label="Visited College for Inquiry"),
121
  gr.Radio(["Yes", "No"], label="Attended Any Event"),
122
  gr.Number(label="College Fee"),