Hemg commited on
Commit
55dff91
·
verified ·
1 Parent(s): 4e375c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -1,5 +1,3 @@
1
-
2
-
3
  import gradio as gr
4
  import joblib
5
  import numpy as np
@@ -39,9 +37,9 @@ def predict_performance(Location, College_Fee,College, GPA, Year, Course_Interes
39
  Visited_College_for_Inquiry_Only, Event, Attended_Any_Events,
40
  Presenter, Visited_Parents]]
41
 
42
- feature_names = ["Location", "College Fee","College", "GPA", "Year", "Course Interested",
43
- "Faculty", "Source", "Visited College for Inquiry Only", "Event",
44
- "Attended Any Events", "Presenter", "Visited Parents"]
45
 
46
  input_df = pd.DataFrame(input_data, columns=feature_names)
47
 
@@ -55,6 +53,9 @@ def predict_performance(Location, College_Fee,College, GPA, Year, Course_Interes
55
  print("\nDataFrame after encoding:")
56
  print(df)
57
 
 
 
 
58
  scaled_input = scaler.transform(df)
59
 
60
  # Debug print 4: Show scaled input
 
 
 
1
  import gradio as gr
2
  import joblib
3
  import numpy as np
 
37
  Visited_College_for_Inquiry_Only, Event, Attended_Any_Events,
38
  Presenter, Visited_Parents]]
39
 
40
+ feature_names = ["Location", "College Fee", "GPA", "Year", "Course Interested",
41
+ "Faculty", "Source", "Visited College for Inquiry Only", "Event",
42
+ "Attended Any Events", "College", "Presenter", "Visited Parents"]
43
 
44
  input_df = pd.DataFrame(input_data, columns=feature_names)
45
 
 
53
  print("\nDataFrame after encoding:")
54
  print(df)
55
 
56
+ # Ensure the DataFrame columns match the scaler's expected input
57
+ df = df.reindex(columns=scaler.feature_names_in_, fill_value=0)
58
+
59
  scaled_input = scaler.transform(df)
60
 
61
  # Debug print 4: Show scaled input