rkrnsRanker: use random forest or svm to predict and rank sentences from...

Description Usage Examples

Description

takes a dataframe that contains a column named lab such that mydf$lab gives the true labeling of the data. trainingRows is a vector identifying which rows should be training data. success is defined by a prediction probability being within the top targetSuccessRate*100 percent. Returns various success metrics.

Usage

1
2
rkrnsRanker(mydfin, trainingRows, targetSuccessRate = 0.15,
  whichmodel = "randomForest", verbose = FALSE)

Examples

1
2
3
4
5
mylabs<-rep(c("a","b","c"),5)
voxeldata<-replicate(100, rnorm(length(mylabs)))
mydf<-data.frame( lab=mylabs, vox=voxeldata)
rfr<-rkrnsRanker( mydf, 1:round(nrow(mydf)/2), whichmodel='svm' )
print( rfr$successPercent )

stnava/RKRNS documentation built on May 30, 2019, 7:21 p.m.