Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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.
|
61 |
|
62 |
# Debug print 4: Show prediction details
|
63 |
print("\nPrediction details:")
|
64 |
-
print(f"
|
65 |
-
prediction_probability = 1 / (1 + np.exp(-prediction))
|
66 |
-
print(f"Probability: {prediction_probability}")
|
67 |
|
68 |
-
prediction_percentage =
|
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}%"
|