MLearn-methods {MLInterfaces} | R Documentation

## Methods for Function MLearn in Package ‘MLInterfaces’

### Description

Initial version of more lightweight interface; please do help(MLearn) for the more recent schema-based approach.

### Methods

The parameters of the generic are `formula`, `data`, `method`, and `trainInds`.

The fundamental method employs a formula and a data.frame instance and applies a machine learning algorithm identified by `method`, specifying the training set indices for the training run. An instance of `MLOutput-class` is returned.

An adaptation allows an `ExpressionSet` instance to be bound to the `data` parameter. The ExpressionSet and phenoData will be converted to a data.frame instance using the internal `es2df` function, and this can be large. Typically the genes will be filtered before applying this procedure.

For this interface, one can obtain the training data confusion matrix using `confuMatTrain`. A slot `predLabelsTr` is populated for this purpose, and an extractor method exists.

### Examples

    library(MASS)
    data(Pima.tr)
    pm = MLearn(type~., data=Pima.tr, "lda", 1:150 )
    confuMatTrain(pm)  # on training data
    confuMat(pm)  # on held-out test data
    #
    pm2 = MLearn(type~., data=Pima.tr, "logistic", 1:150, mlSpecials=
      list(thresh=.2) )
    confuMat(pm2)
    #
    library(golubEsets)
    data(Golub_Merge)
    rp = MLearn(ALL.AML~., Golub_Merge[1:200,], "rpart", 1:35 )
    confuMat(rp)
    sv = MLearn(ALL.AML~., Golub_Merge[1:200,], "svm", 1:35 )
    confuMat(sv)
    confuMatTrain(sv)
    # illustrate real adaboost
    rab = MLearn(ALL.AML~., Golub_Merge[1:200,], "RAB", 1:35,
       maxiter=20, maxdepth=2)
    confuMatTrain(rab)
    confuMat(rab)
    # illustrate regularized discriminant analysis
    rda = MLearn(ALL.AML~., Golub_Merge[1:2000,], "rdacv", 1:35 )
    confuMatTrain(rda)
    confuMat(rda)

[Package MLInterfaces version 1.12.0 Index]