DaMiR.EnsembleLearning2cl_Training {DaMiRseq} | R Documentation

## Train a Binary Classifier using 'Staking' Learning strategy.

### Description

This function learn a meta learner by a 'Stacking' strategy. Users can provide heterogeneous features (other than genomic features) which will be taken into account during classification model building. A 'two-classes' classification task is addressed.

### Usage

    DaMiR.EnsembleLearning2cl_Training(data, classes, variables,
      fSample.tr.w = 0.7, iter = 100, cl_type = c("RF", "SVM", "LDA", "LR",
      "NB", "NN", "PLS"), type_model = c("median", "best"))

### Arguments

`data` | A transposed data frame of normalized expression data. Rows and Cols should be, respectively, observations and features
`classes` | A class vector with `nrow(data)` elements. Each element represents the class label for each observation. Two different class labels are allowed
`variables` | An optional data frame containing other variables (but without 'class' column). Each column represents a different covariate to be considered in the model
`fSample.tr.w` | Fraction of samples of training set to be used during weight estimation; default is 0.7
`iter` | Number of iterations to assess classification accuracy; default is 100
`cl_type` | List of weak classifiers that will compose the meta-learners. "RF", "SVM", "LDA", "LR", "NB", "NN", "PLS" are allowed. Default is c("RF", "LR", "LDA", "NB", "SVM")
`type_model` | Select the model with the median or best accuracy over the iteration. "median" and "best" are allowed. Default: median

### Details

This function implements the training step of DaMiR.EnsembleLearning2cl function

### Value

A list containing:

- The models of each classifier used to build the Ensemble meta-learner with the median or the best accuracy (over the iteration) for the Ensemble classifier;

- the weights associated to each weak classifier;

### Author(s)

Mattia Chiesa, Luca Piacentini

### Examples

    # use example data:
    data(selected_features)
    data(df)
    set.seed(1)
    # For the example:
    # speed up the process setting a low 'iter' argument value;
    # for real data set use default 'iter' value (i.e. 100) or higher:
    #  Classification_res <- DaMiR.EnsembleLearning2cl_Training(
    #  selected_features,classes=df$class, fSample.tr.w=0.6, iter=3,
    # cl_type=c("RF","LR"))

[Package DaMiRseq version 1.6.2 Index]