Main Content

La traducción de esta página está obsoleta. Haga clic aquí para ver la última versión en inglés.

Naive Bayes

Modelo Naive Bayes con predictores gaussianos, multinomiales o de kernel

Los modelos Naive Bayes suponen que las observaciones tienen alguna distribución multivariante dada la pertenencia a una clase, aunque el predictor o las características que componen la observación son independientes. Este marco puede dar cabida a un conjunto completo de características, de manera que una observación es un conjunto de recuentos multinomiales.

Para entrenar un modelo Naive Bayes, utilice fitcnb en la interfaz de línea de comandos. Tras el entrenamiento, prediga las etiquetas o calcule las probabilidades a posteriori pasando el modelo y los datos de los predictores a predict.

Apps

Classification LearnerTrain models to classify data using supervised machine learning

Funciones

expandir todo

fitcnbTrain multiclass naive Bayes model
compactReduce size of machine learning model
limeLocal interpretable model-agnostic explanations (LIME)
partialDependenceCompute partial dependence
plotPartialDependenceCreate partial dependence plot (PDP) and individual conditional expectation (ICE) plots
shapleyShapley values
crossvalCross-validate machine learning model
kfoldEdgeClassification edge for cross-validated classification model
kfoldLossClassification loss for cross-validated classification model
kfoldfunCross-validate function for classification
kfoldMarginClassification margins for cross-validated classification model
kfoldPredictClassify observations in cross-validated classification model
lossClassification loss for naive Bayes classifier
resubLossResubstitution classification loss
logpLog unconditional probability density for naive Bayes classifier
compareHoldoutCompare accuracies of two classification models using new data
edgeClassification edge for naive Bayes classifier
marginClassification margins for naive Bayes classifier
resubEdgeResubstitution classification edge
resubMarginResubstitution classification margin
testckfoldCompare accuracies of two classification models by repeated cross-validation
predictClassify observations using naive Bayes classifier
resubPredictClassify training data using trained classifier
incrementalLearnerConvert naive Bayes classification model to incremental learner

Clases

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

Temas

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.

Classification

This example shows how to perform classification using discriminant analysis, naive Bayes classifiers, and decision trees.

Visualize Decision Surfaces of Different Classifiers

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