Cập nhật mã nguồn và file Colab Cache

This commit is contained in:
2026-07-16 19:32:43 +07:00
parent 25969cb0f5
commit a258db54cd
69 changed files with 3377 additions and 645 deletions
+23
View File
@@ -0,0 +1,23 @@
import numpy as np
from xgboost import XGBClassifier
from sklearn.datasets import make_classification
from sklearn.metrics import accuracy_score
print("🚀 Testing XGBoost with CUDA GPU...")
try:
X, y = make_classification(n_samples=10000, n_features=20, n_classes=2, random_state=42)
model = XGBClassifier(
n_estimators=100,
max_depth=10,
tree_method="hist",
device="cuda",
random_state=42,
verbosity=1
)
print("Training model...")
model.fit(X, y)
y_pred = model.predict(X)
acc = accuracy_score(y, y_pred)
print(f"✅ Training successful! Accuracy: {acc*100:.2f}%")
except Exception as e:
print(f"❌ Error during training: {e}")