我是catboost的新手,我想在一次迭代中在R中的虹膜数据集上运行该算法。我从预测函数的输出中注意到了负概率。知道为什么会这样吗? 另外,有没有办法在R中绘制catboost树?
test <- as.data.frame(iris)
test$y <- ifelse(test$Species=="setosa",1,0)
x_iris <- test[,c("Sepal.Length","Sepal.Width","Petal.Length","Petal.Width")]
y_iris <- test[,"y"]
train <- as.data.frame(lapply(x_iris, as.numeric))
train_pool <- catboost.load_pool(data = train, label = y_iris)
model <- catboost.train(train_pool, NULL,
params = list(loss_function = 'Logloss',
iterations = 1, metric_period=10))
print(prediction)
答案 0 :(得分:0)
在python中:我们必须设置prediction_type='Probability'