Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -57,13 +57,17 @@ 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 |
-
#
|
63 |
-
|
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}%"
|
|
|
57 |
scaled_input = scaler.transform(df)
|
58 |
|
59 |
# Make the prediction
|
60 |
+
prediction = model.predict(scaled_input)[0]
|
61 |
|
62 |
+
# Clip the prediction to be between 0 and 1
|
63 |
+
prediction = np.clip(prediction, 0, 1)
|
|
|
64 |
|
65 |
+
# Convert to percentage
|
66 |
prediction_percentage = prediction * 100
|
67 |
+
|
68 |
+
# Debug print
|
69 |
+
print("\nPrediction details:")
|
70 |
+
print(f"Raw prediction: {prediction}")
|
71 |
print(f"Percentage: {prediction_percentage}")
|
72 |
|
73 |
return f"Chance of Admission: {prediction_percentage:.1f}%"
|