Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -28,6 +28,14 @@ app.add_middleware(
|
|
| 28 |
|
| 29 |
def train_the_model(data,page):
|
| 30 |
if page==2:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
new_data = data
|
| 32 |
encoders = load('encoders.joblib')
|
| 33 |
xgb_model = load('xgb_model.joblib')
|
|
|
|
| 28 |
|
| 29 |
def train_the_model(data,page):
|
| 30 |
if page==2:
|
| 31 |
+
# Function to evaluate the model
|
| 32 |
+
def evaluate_model(model, X_test, y_test):
|
| 33 |
+
y_pred = model.predict(X_test)
|
| 34 |
+
accuracy = accuracy_score(y_test, y_pred)
|
| 35 |
+
print("Accuracy:", accuracy)
|
| 36 |
+
print("Classification Report:\n", classification_report(y_test, y_pred))
|
| 37 |
+
return accuracy
|
| 38 |
+
|
| 39 |
new_data = data
|
| 40 |
encoders = load('encoders.joblib')
|
| 41 |
xgb_model = load('xgb_model.joblib')
|