你好,randomForest的predict函数中有个type参数可以设置,
type:
one of response, prob. or votes, indicating the type of output: predicted values, matrix of class probabilities, or matrix of vote counts. class is allowed, but automatically converted to "response", for backward compatibility.
1 个回复
marxsong 2016-12-14 回答
赞同来自: 梁勇
type:
one of response, prob. or votes, indicating the type of output: predicted values, matrix of class probabilities, or matrix of vote counts. class is allowed, but automatically converted to "response", for backward compatibility.
你要输出为概率值,则只需要令type = 'prob'
举个例子: