Spaces:
Runtime error
Runtime error
| import numpy as np | |
| import xgboost as xgb | |
| from sklearn.metrics import accuracy_score, classification_report, confusion_matrix | |
| X_test = np.load("featureextraction/final_features/test_X.npy") | |
| y_test = np.load("featureextraction/final_features/test_y.npy") | |
| print("Test shape:", X_test.shape) | |
| model = xgb.XGBClassifier() | |
| model.load_model("classifier/xgboost_final_model.json") | |
| y_pred = model.predict(X_test) | |
| print("\nTEST SET RESULTS (FINAL MODEL)\n") | |
| print("Accuracy:", accuracy_score(y_test, y_pred)) | |
| print("\nClassification Report:\n") | |
| print( | |
| classification_report( | |
| y_test, | |
| y_pred, | |
| target_names=["Human", "AI"] | |
| ) | |
| ) | |
| print("\nConfusion Matrix:\n") | |
| print(confusion_matrix(y_test, y_pred)) | |