Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -53,19 +53,24 @@ def predict_performance(Location, Course, College, Faculty, Source, Event, Prese
|
|
53 |
print("\nDataFrame after encoding:")
|
54 |
print(df)
|
55 |
|
56 |
-
#
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
-
|
67 |
# Make the prediction
|
68 |
-
prediction = model.predict(
|
69 |
|
70 |
# Clip the prediction to be between 0 and 1
|
71 |
prediction = np.clip(prediction, 0, 1)
|
|
|
53 |
print("\nDataFrame after encoding:")
|
54 |
print(df)
|
55 |
|
56 |
+
# Extract features to scale
|
57 |
+
features_to_scale = df[["College Fee", "Year"]]
|
58 |
+
|
59 |
+
# Scale only the College Fee and Year
|
60 |
+
scaled_features = scaler.transform(features_to_scale)
|
61 |
+
|
62 |
+
# Replace the original features with the scaled features
|
63 |
+
df[["College Fee", "Year"]] = scaled_features
|
64 |
+
|
65 |
+
# Debug print: Show DataFrame after scaling
|
66 |
+
print("\nDataFrame after scaling:")
|
67 |
+
print(df)
|
68 |
+
|
69 |
+
# Prepare the input for the model
|
70 |
+
model_input = df.values # Convert DataFrame to numpy array for model input
|
71 |
|
|
|
72 |
# Make the prediction
|
73 |
+
prediction = model.predict(model_input)[0]
|
74 |
|
75 |
# Clip the prediction to be between 0 and 1
|
76 |
prediction = np.clip(prediction, 0, 1)
|