Description Usage Arguments Details Value Author(s) See Also Examples

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

1 2 3 4 |

`x` |
a numeric matrix, or a data frame of categorical and/or numeric variables. |

`grouping` |
class vector (a factor). |

`formula` |
a formula of the form |

`data` |
a data frame of predictors (categorical and/or numeric). |

`prior` |
the prior probabilities of class membership. If unspecified, the class proportions for the training set are used. If present, the probabilities should be specified in the order of the factor levels. |

`usekernel` |
if |

`fL` |
Factor for Laplace correction, default factor is 0, i.e. no correction. |

`...` |
arguments passed to |

`subset` |
for data given in a data frame, an index vector specifying the cases to be used in the training sample. (NOTE: If given, this argument must be named.) |

`na.action` |
a function to specify the action to be taken if |

This implementation of Naive Bayes as well as this help is based on the code by
David Meyer in the package e1071 but extended for kernel estimated densities and user
specified `prior`

probabilities.
The standard naive Bayes classifier (at least this implementation)
assumes independence of the predictor
variables.

An object of class `"NaiveBayes"`

including components:

`apriori` |
Class distribution for the dependent variable. |

`tables` |
A list of tables, one for each predictor variable. For each
categorical variable a table giving, for each attribute level, the conditional
probabilities given the target class. For each numeric variable, a
table giving, for each target class, mean and standard deviation of
the (sub-)variable or a object of |

Karsten Luebke, [email protected]

`predict.NaiveBayes`

,`plot.NaiveBayes`

,`naiveBayes`

,`qda`

1 2 | ```
data(iris)
m <- NaiveBayes(Species ~ ., data = iris)
``` |

```
Loading required package: MASS
```

klaR documentation built on March 19, 2018, 5:03 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.