例如,当我在R(pROC包)中使用multiclass.roc函数时,我通过随机林训练了一个数据集,这是我的代码:
# randomForest & pROC packages should be installed:
# install.packages(c('randomForest', 'pROC'))
data(iris)
library(randomForest)
library(pROC)
set.seed(1000)
# 3-class in response variable
rf = randomForest(Species~., data = iris, ntree = 100)
# predict(.., type = 'prob') returns a probability matrix
multiclass.roc(iris$Species, predict(rf, iris, type = 'prob'))
Run Code Online (Sandbox Code Playgroud)
结果是:
Call:
multiclass.roc.default(response = iris$Species, predictor = predict(rf,
iris, type = "prob"))
Data: predict(rf, iris, type = "prob") with 3 levels of iris$Species: setosa,
versicolor, virginica.
Multi-class area under the curve: 0.5142
Run Code Online (Sandbox Code Playgroud)
这是正确的吗?谢谢!!!
"pROC"参考:http …
我想计算 Maxima 中 x=pi/4 处 tan(x) 的七阶导数:
f(x) := diff(tan(x), x, 7);
f(%pi / 4);
Run Code Online (Sandbox Code Playgroud)
但我无法得到结果。有想法吗?
我有一个数据框(名为'mdf'),其中包含两列.基本信息如下:
> head(mdf); tail(mdf)
Country Rank
1 ABW 161
2 AFG 105
3 AGO 60
4 ALB 125
5 ARE 32
6 ARG 26
Country Rank
184 WSM 181
185 YEM 90
186 ZAF 28
187 ZAR 112
188 ZMB 104
189 ZWE 134
> str(mdf)
'data.frame': 189 obs. of 2 variables:
$ Country: Factor w/ 229 levels "","ABW","ADO",..: 2 4 5 6 7 8 9 11 12 13 ...
$ Rank : Factor w/ 195 levels "",".. Not available. …Run Code Online (Sandbox Code Playgroud)