Description Usage Arguments Value See Also Examples
View source: R/Prediction_operators.R
Get probabilities for some classes.
1 | getPredictionProbabilities(pred, cl)
|
pred |
[ |
cl |
[ |
[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
,
plotViperCharts
,
predict.WrappedModel
,
setPredictThreshold
,
setPredictType
1 2 3 4 5 6 7 8 9 10 11 | task = makeClassifTask(data = iris, target = "Species")
lrn = makeLearner("classif.lda", predict.type = "prob")
mod = train(lrn, task)
# predict probabilities
pred = predict(mod, newdata = iris)
# Get probabilities for all classes
head(getPredictionProbabilities(pred))
# Get probabilities for a subset of classes
head(getPredictionProbabilities(pred, c("setosa", "virginica")))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.