buildClassifier {cleanUpdTSeq} | R Documentation

## Build a Naive Bayes Classifier

### Description

Computes the conditional a-posterior probabilities of a categorical class variable given independent predictor variables using the Bayes rule.

### Usage

    buildClassifier(
      Ndata.NaiveBayes,
      Pdata.NaiveBayes,
      upstream = 40L,
      downstream = 30L,
      wordSize = 6L,
      genome = Drerio,
      alphabet = c("ACGT")
    )

### Arguments

`Ndata.NaiveBayes` | A data.frame, containing features for the negative training data, described further in `data.NaiveBayes`.
`Pdata.NaiveBayes` | A data.frame, containing features for the positive training data, described further in `data.NaiveBayes`.
`upstream` | An integer(1) vector, length of upstream sequence to retrieve.
`downstream` | An integer(1) vector, length of downstream sequence to retrieve.
`wordSize` | An integer(1) vector, size of the kmer feature for the upstream sequence. wordSize = 6 should always be used.
`genome` | Name of the genome to get sequences from. To find out a list of available genomes, please type BSgenome::available.genomes() in R.
`alphabet` | A character(1) vector, a string containing DNA bases. By default, "ACTG".

### Value

An object of class "naiveBayes".

### Author(s)

Jianhong Ou

### See Also

`naiveBayes`

### Examples

    if (interactive()){
        data(data.NaiveBayes)
        classifier <- buildClassifier(data.NaiveBayes$Negative,
                                      data.NaiveBayes$Positive)
    }

[Package cleanUpdTSeq version 1.30.0 Index]