code_5.py 240 字节
Newer Older
ToTensor's avatar
ToTensor 已提交
1 2 3
from sklearn.metrics import (accuracy_score, confusion_matrix)
y_hat_rfgs = rf_gs.predict(X_test) # 用随机森林算法的最佳参数进行预测
print("参数优化后随机森林预测准确率:", accuracy_score(y_test.T, y_hat_rfgs))