Description Usage Arguments Value See Also Examples
Analyzing results of supervised model using test data and quantiles. Note only
model
or testPred
are necessary, not both. testPred
is advised.
1 2 | predQuantile(model = NULL, xtest = NULL, ytest, n = 5, roundText = 3,
testPred = NULL, fw = NULL)
|
model |
the model to get predictions from. Uses |
ytest |
vector of test data (target variable) |
n |
number of quantiles |
roundText |
decimals to print |
testPred |
vector of predictions from test data. Do not use if using |
fw |
numeric vector, of bins. Defaults to |
xtext |
data.frame of test data (predictor variables only) |
data.frame of results
1 2 3 4 5 6 7 8 9 | require('randomForest')
rf <- randomForest(x=mtcars[1:25,1:8], y=as.factor(mtcars[1:25, 'am']), ntree=5)
mtcarsTestPred <- predict(rf, mtcars[26:32, 1:8], type='prob')[,2]
pq2 <- predQuantile(xtest=mtcars[26:32, 1:8], ytest=mtcars[26:32, 'am'], n=3, roundText=4, testPred=mtcarsTestPred)
pq <- predQuantile(xtest=mtcars[26:32, 1:8], ytest=mtcars[26:32, 'am'], fw=seq(.1,1,length.out=10), roundText=4, testPred=mtcarsTestPred)
barplot(pq$actual, names=pq$predRange, ylab='True Positives', las=2, cex.names=.7)
barplot(pq$hitRate, names=pq$predRange, ylab='True Positive Hit Rate', las=2, cex.names=.7)
barplot(pq$predMax-pq$predMin, pq$hitRate, names=pq$predRange, ylab='prediction', las=2, cex.names=.7)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.