Spaces:
Sleeping
Sleeping
★彡[ᴊᴜɴᴀɪᴅ ᴋʜᴀᴛᴛᴀᴋ]彡★ commited on
Commit ·
a3bbcf6
1
Parent(s): ec2d273
zainnnnn
Browse files
app.py
CHANGED
|
@@ -6,11 +6,16 @@ from sklearn.preprocessing import StandardScaler
|
|
| 6 |
|
| 7 |
app = FastAPI()
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
# Load the model
|
| 10 |
with open('random_forest_model.pkl', 'rb') as model_file:
|
| 11 |
model = pickle.load(model_file)
|
| 12 |
|
| 13 |
-
# Dummy scaler initialization (
|
| 14 |
scaler = StandardScaler()
|
| 15 |
scaler.mean_ = [0.5, 0.5, 2.5, 2.5, 20, 50] # Example means
|
| 16 |
scaler.scale_ = [0.5, 0.5, 1, 1, 10, 20] # Example stds
|
|
|
|
| 6 |
|
| 7 |
app = FastAPI()
|
| 8 |
|
| 9 |
+
# Root route for Hugging Face health check
|
| 10 |
+
@app.get("/")
|
| 11 |
+
def read_root():
|
| 12 |
+
return {"message": "Dropout prediction API is running!"}
|
| 13 |
+
|
| 14 |
# Load the model
|
| 15 |
with open('random_forest_model.pkl', 'rb') as model_file:
|
| 16 |
model = pickle.load(model_file)
|
| 17 |
|
| 18 |
+
# Dummy scaler initialization (adjust with real stats if available)
|
| 19 |
scaler = StandardScaler()
|
| 20 |
scaler.mean_ = [0.5, 0.5, 2.5, 2.5, 20, 50] # Example means
|
| 21 |
scaler.scale_ = [0.5, 0.5, 1, 1, 10, 20] # Example stds
|