Naive Bayes
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 Learner | Entrenar modelos para clasificar datos usando machine learning supervisado |
Bloques
ClassificationNaiveBayes Predict | Classify observations using naive Bayes model (desde R2023b) |
Funciones
Objetos
ClassificationPartitionedModel | Cross-validated classification model |
Clases
ClassificationNaiveBayes | Naive Bayes classification for multiclass classification |
CompactClassificationNaiveBayes | Compact naive Bayes classifier for multiclass classification |
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
Learn about parametric classification methods.
- 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.