确定H2O随机森林模型的准确性,精度,召回率和F分数

时间:2020-10-29 07:55:34

标签: python random-forest h2o

我正在使用H2ORandomForestEstimator进行多类分类。

经过如下培训和构建:

train, valid = hdf.split_frame(ratios=[.8], seed=1234)
# Build and train the model:
drf = H2ORandomForestEstimator(model_id="drf", seed=1234)
drf.train(x=predictors,
               y=response,
               training_frame=train,
               validation_frame=valid)

drf.model_performance(valid)

我可以在输出中看到每个类的RMSE,MSE和平均错误

ModelMetricsMultinomial: drf
** Reported on test data. **

MSE: 0.12204577776460168
RMSE: 0.34935050846478194
LogLoss: 0.4781165975023516
Mean Per-Class Error: 0.23864386780117242

如何获取其他指标,例如准确性,准确性,召回率和F分数?

1 个答案:

答案 0 :(得分:1)

Precision,Recall和F-Score仅适用于二进制分类。您有一个多类案例,这就是为什么您看不到它们的原因。用户指南中提供了更多信息:http://docs.h2o.ai/h2o/latest-stable/h2o-docs/performance-and-prediction.html