Learn R Programming

pRoloc (version 1.12.4)

nbClassification: nb classification

Description

Classification using the naive Bayes algorithm.

Usage

nbClassification(object, assessRes, scores = c("prediction", "all", "none"), laplace, fcol = "markers", ...)

Arguments

object
An instance of class "MSnSet".
assessRes
An instance of class "GenRegRes", as generated by nbOptimisation.
scores
One of "prediction", "all" or "none" to report the score for the predicted class only, for all cluster or none.
laplace
If assessRes is missing, a laplace must be provided.
fcol
The feature meta-data containing marker definitions. Default is markers.
...
Additional parameters passed to naiveBayes from package e1071.

Value

An instance of class "MSnSet" with nb and nb.scores feature variables storing the classification results and scores respectively.

Examples

Run this code
library(pRolocdata)
data(dunkley2006)
## reducing parameter search space and iterations 
params <- nbOptimisation(dunkley2006, laplace = c(0, 5),  times = 3)
params
plot(params)
f1Count(params)
levelPlot(params)
getParams(params)
res <- nbClassification(dunkley2006, params)
getPredictions(res, fcol = "naiveBayes")
getPredictions(res, fcol = "naiveBayes", t = 1)
plot2D(res, fcol = "naiveBayes")

Run the code above in your browser using DataLab