runClassifier: Fit a classifier model.

Description Usage Arguments Value Examples

View source: R/runClassifier.R

Description

Run the classifier on a training set and measure performance on a validation set.

Usage

1
2
3
4
5
6
7
8
runClassifier(
  trainingSet,
  validationSet,
  params,
  classifierAlgorithm,
  metric = "acc",
  interp = 0
)

Arguments

trainingSet

Dataframe of the training set.

validationSet

Dataframe of the validation Set.

params

A string character of parameter configuration values for the current classifier to be tuned (parameters are separated by #) and can be obtained from params out of resulted list after running autoRLearn function.

classifierAlgorithm

String character of the name of classifier algorithm used now.

  • "svm" - Support Vector Machines from e1071 package,

  • "naiveBayes" - naiveBayes from e1071 package,

  • "randomForest" - randomForest from randomForest package,

  • "lmt" - LMT Weka classifier trees from RWeka package,

  • "lda" - Linear Discriminant Analysis from MASS package,

  • "j48" - J48 Weka classifier Trees from RWeka package,

  • "bagging" - Bagging Classfier from ipred package,

  • "knn" - K nearest Neighbors from FNN package,

  • "nnet" - Simple neural net from nnet package,

  • "C50" - C50 decision tree from C5.0 pacakge,

  • "rpart" - rpart decision tree from rpart package,

  • "rda" - regularized discriminant analysis from klaR package,

  • "plsda" - Partial Least Squares And Sparse Partial Least Squares Discriminant Analysis from caret package,

  • "glm" - Fitting Generalized Linear Models from stats package,

  • "deepboost" - deep boost classifier from deepboost package.

metric

Metric string character to be used in evaluation:

  • "acc" - Accuracy,

  • "avg-fscore" - Average of F-Score of each label,

  • "avg-recall" - Average of Recall of each label,

  • "avg-precision" - Average of Precision of each label,

  • "fscore" - Micro-Average of F-Score of each label,

  • "recall" - Micro-Average of Recall of each label,

  • "precision" - Micro-Average of Precision of each label

interp

Boolean representing if interpretability is required or not (Default = 0).

Value

List of performance on validationSet named perf, model fitted on trainingSet named m, predictions on test set pred, and interpretability plots named interpret in case of interp = 1

Examples

1
2
3
4
5
6
## Not run: 
result1 <- autoRLearn(10, 'sampleDatasets/shuttle/train.arff', 'sampleDatasets/shuttle/test.arff')
dataset <- datasetReader('/Datasets/irisTrain.csv', '/Datasets/irisTest.csv')
result2 <- runClassifier(dataset$Train, dataset$Test, result1$params, result1$clfs)

## End(Not run)

DataSystemsGroupUT/SmartML documentation built on Nov. 24, 2020, 1:31 p.m.