baseModel | R Documentation |
Prediction by Machine Learning with different learners ( From 'mlr3' )
baseModel(
trainData,
testData,
predMode = "probability",
classifier,
paramlist = NULL,
inner_folds = 10,
seed = 10
)
trainData |
The input training dataset. The first column is the label or the output. For binary classes, 0 and 1 are used to indicate the class member. |
testData |
The input test dataset. The first column is the label or the output. For binary classes, 0 and 1 are used to indicate the class member. |
predMode |
The prediction mode.Currently only supports 'probability' for binary classification tasks. |
classifier |
Learners in mlr3 |
paramlist |
Learner parameters search spaces |
inner_folds |
k-fold cross validation ( Only supported when testData = NULL ) |
seed |
Cross-Validation seed |
The predicted output for the test data.
Shunjie Zhang
library(mlr3verse)
library(caret)
library(BioM2)
data=MethylData_Test
set.seed(1)
part=unlist(createDataPartition(data$label,p=0.8))#Split data
predict=baseModel(trainData=data[part,1:10],
testData=data[-part,1:10],
classifier = 'svm')#Use 10 features to make predictions,Learner uses svm
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.