Get probabilities for some classes.
getPredictionProbabilities(pred, cl)
pred | (Prediction) |
---|---|
cl | (character) |
(data.frame) with numerical columns or a numerical vector if length of cl
is 1.
Order of columns is defined by cl
.
Other predict:
asROCRPrediction()
,
getPredictionResponse()
,
getPredictionTaskDesc()
,
predict.WrappedModel()
,
setPredictThreshold()
,
setPredictType()
task = makeClassifTask(data = iris, target = "Species") lrn = makeLearner("classif.lda", predict.type = "prob") mod = train(lrn, task)#> Error: Please use column names for `x`#> Error in predict(mod, newdata = iris): object 'mod' not found#> Error in checkClass(x, classes, ordered, null.ok): object 'pred' not found# Get probabilities for a subset of classes head(getPredictionProbabilities(pred, c("setosa", "virginica")))#> Error in checkClass(x, classes, ordered, null.ok): object 'pred' not found