Description Usage Arguments Value See Also Examples
View source: R/carrot_functions.R
Function which makes a prediction for multinomial/logistic regression based on the given cutoff value and probabilities.
1  get_predictions(p,k,cutoff,cmode,mode)

p 
probabilities of the outcomes for the test set given either by an array (logistic regression) or by a matrix (multinomial regression) 
k 
size of the test set 
cutoff 
cutoff value of the probability 
cmode 

mode 

Outputs the array of the predictions of the size of p
.
1 2 3 4 5 6 7 8 9 10 11 12 13  #binary mode
get_predictions(runif(20,0.4,0.6),20,0.5,'det','binary')
#creating a dataset for multinomial mode
p1<runif(20,0.4,0.6)
p2<runif(20,0.1,0.2)
p3<1p1p2
#running the function
get_predictions(matrix(c(p1,p2,p3),ncol=3),20,0.5,'det','multin')

[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0 1 0 0 1 1 0 0 0 1 0 1 1 0
[,15] [,16] [,17] [,18] [,19] [,20]
[1,] 1 0 1 0 1 0
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0 0 2 0 2 0 2 0 0 0 0 0 0 0
[,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 2 2 0 0 0
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.