Esta página aún no se ha traducido para esta versión. Puede ver la versión más reciente de esta página en inglés.

Vecinos más cercanos

k clasificación de vecinos más cercano usando Kd-Tree Search

Para entrenar a un modelo de vecinos más cercano a k, use la aplicación Estudiante de clasificación. Para mayor flexibilidad, entrene un modelo de vecinos kusando fitcknn en la interfaz de línea de comandos. Después del entrenamiento, predecir las etiquetas o estimar las probabilidades posteriores pasando el modelo y los Datos predictores a predict.

Aplicaciones

Estudiante de clasificaciónTrain models to classify data using supervised machine learning

Funciones

expandir todo

fitcknnFit k-nearest neighbor classifier
ExhaustiveSearcherCreate exhaustive nearest neighbor searcher
KDTreeSearcherCreate Kd-tree nearest neighbor searcher
creatensCreate nearest neighbor searcher object
crossvalCross-validated k-nearest neighbor 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
lossLoss of k-nearest neighbor classifier
resubLossLoss of k-nearest neighbor classifier by resubstitution
compareHoldoutCompare accuracies of two classification models using new data
edgeEdge of k-nearest neighbor classifier
marginMargin of k-nearest neighbor classifier
resubEdgeEdge of k-nearest neighbor classifier by resubstitution
resubMarginMargin of k-nearest neighbor classifier by resubstitution
predictPredict labels using k-nearest neighbor classification model
resubPredictPredict resubstitution response of k-nearest neighbor classifier
pdistPairwise distance between pairs of observations
pdist2Pairwise distance between two sets of observations

Objetos

expandir todo

ClassificationKNNk-nearest neighbor classification
ClassificationPartitionedModelCross-validated classification model

Temas

Train Nearest Neighbor Classifiers Using Classification Learner App

Create and compare nearest neighbor classifiers, and export trained models to make predictions for new data.

Visualize Decision Surfaces of Different Classifiers

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

Supervised Learning Workflow and Algorithms

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

Classification Using Nearest Neighbors

Categorize data points based on their distance to points in a training data set, using a variety of distance metrics.