Hemg commited on
Commit
f3d3244
·
verified ·
1 Parent(s): 06b7825

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -57,15 +57,13 @@ def predict_performance(Location, Course, College, Faculty, Source, Event, Prese
57
  scaled_input = scaler.transform(df)
58
 
59
  # Make the prediction
60
- prediction = model.predict(scaled_input)[0]
61
 
62
  # Debug print 4: Show prediction details
63
  print("\nPrediction details:")
64
- print(f"Raw prediction: {prediction}")
65
- prediction_probability = 1 / (1 + np.exp(-prediction))
66
- print(f"Probability: {prediction_probability}")
67
 
68
- prediction_percentage = prediction_probability * 100
69
  print(f"Percentage: {prediction_percentage}")
70
 
71
  return f"Chance of Admission: {prediction_percentage:.1f}%"
 
57
  scaled_input = scaler.transform(df)
58
 
59
  # Make the prediction
60
+ prediction = model.predict_proba(scaled_input)[0][1] # Get probability for positive class
61
 
62
  # Debug print 4: Show prediction details
63
  print("\nPrediction details:")
64
+ print(f"Probability: {prediction}")
 
 
65
 
66
+ prediction_percentage = prediction * 100
67
  print(f"Percentage: {prediction_percentage}")
68
 
69
  return f"Chance of Admission: {prediction_percentage:.1f}%"