Skip to contents

# Train a machine learning classifier for the clinical classification of HDFC data.

Source: `R/clinical_classifier.R`
`train_classifier_model.Rd`

This function trains a machine learning classifier for the clinical classification of HDFC data. This function uses the *CytoDx* framework.

## Usage

    train_classifier_model(
      fcd,
      input_type,
      data_slot,
      sample_names = "expfcs_filename",
      classification_variable,
      family = "binomial",
      type1 = "response",
      type2 = "response",
      parallelCore = 1,
      reg = FALSE,
      seed = 91
    )

## Arguments

fcd

  flow cytometry data set.

input_type

  data to use for the calculation, e.g. "expr" (suggested option).

data_slot

  Name of the data slot to use for the classification, suggested options are "orig" or "norm".

sample_names

  Column name of the metadata table containing the samples names.

classification_variable

  Vector (same length as number of cells) with the classes to classify (e.g. ctrl/dis).

family

  Response type. Must be one of the following: "gaussian","binomial","poisson","multinomial","cox","mgaussian".

type1

  Type of first level prediction. Type of prediction required. Type "link" gives the linear predictors for "binomial", "multinomial", "poisson" or "cox" models; for "gaussian" models it gives the fitted values. Type "response" gives the fitted probabilities for "binomial" or "multinomial", fitted mean for "poisson" and the fitted relative-risk for "cox"; for "gaussian" type "response" is equivalent to type "link".

type2

  Type of second level prediction.

parallelCore

  Number of cores to be used.

reg

  If elestic net regularization will be used (Default: FALSE).

seed

  A seed is set for reproducibility.

## Value

train_classifier_model

## Details

Train Clinical Classifier

`train_classifier_model()` is a wrapper function around `CytoDx.fit` implemented in the package *CytoDx*. The user can specify all the parameters available for the `CytoDx.fit` functions, arguments description were copied from the documentation of the *CytoDx* package. The function output a *condor* object including the machine learning model in the *extras* slot.