我的回答是一个分类变量(一些字母表),所以在制作模型时我使用了='multinomial',现在我想预测响应并根据这些字母而不是概率矩阵来获得输出.
然而,在predict(model, newdata, type='response')
它中,它给出概率,与结果相同type='link'
.
有没有办法获得分类输出?
BST = gbm(V1~.,data=training,distribution='multinomial',n.trees=2000,interaction.depth=4,cv.folds=5,shrinkage=0.005)
predBST = predict(BST,newdata=test,type='response')
Run Code Online (Sandbox Code Playgroud)