本页对应的英文页面已更新,但尚未翻译。 若要查看最新内容,请点击此处访问英文页面。

朴素贝叶斯

具有高斯预测变量、多项预测变量或核预测变量的朴素贝叶斯模型

朴素贝叶斯模型假设在给定类成员关系的情况下,观测值具有某种多元分布,但构成观测值的预测变量或特征是彼此独立的。此框架可以容纳完整的特征集,这样一个观测值即为一个多项计数集。

要训练朴素贝叶斯模型,可以在命令行界面中使用 fitcnb。训练模型后,可将模型和预测变量数据传递给 predict,以预测标签或估计后验概率。

App

Classification LearnerTrain models to classify data using supervised machine learning

函数

全部展开

fitcnbTrain multiclass naive Bayes model
compactCompact naive Bayes classifier
crossvalCross-validated naive Bayes classifier
kfoldEdgeClassification edge for observations not used for training
kfoldLossClassification loss for observations not used for training
kfoldfunCross validate function
kfoldMarginClassification margins for observations not used for training
kfoldPredictPredict response for observations not used for training
lossClassification error for naive Bayes classifier
resubLossClassification loss for naive Bayes classifiers by resubstitution
logPLog unconditional probability density for naive Bayes classifier
compareHoldoutCompare accuracies of two classification models using new data
edgeClassification edge for naive Bayes classifiers
marginClassification margins for naive Bayes classifiers
resubEdgeClassification edge for naive Bayes classifiers by resubstitution
resubMarginClassification margins for naive Bayes classifiers by resubstitution
predictPredict labels using naive Bayes classification model
resubPredictPredict resubstitution labels of naive Bayes classifier

ClassificationNaiveBayesNaive Bayes classification
CompactClassificationNaiveBayesCompact naive Bayes classifier
ClassificationPartitionedModelCross-validated classification model

主题

Train Naive Bayes Classifiers Using Classification Learner App

Create and compare naive Bayes classifiers, and export trained models to make predictions for new data.

Supervised Learning Workflow and Algorithms

Understand the steps for supervised learning and the characteristics of nonparametric classification and regression functions.

Parametric Classification

Categorical response data

Naive Bayes Classification

The naive Bayes classifier is designed for use when predictors are independent of one another within each class, but it appears to work well in practice even when that independence assumption is not valid.

Plot Posterior Classification Probabilities

This example shows how to visualize classification probabilities for the Naive Bayes classification algorithm.

分类

此示例说明如何使用判别分析、朴素贝叶斯分类器和决策树进行分类。

Visualize Decision Surfaces of Different Classifiers

This example shows how to visualize the decision surface for different classification algorithms.