Main Content

최근접이웃

k-최근접이웃 분류

k-최근접이웃 모델을 훈련시키려면 분류 학습기 앱을 사용하십시오. 명령줄 인터페이스에서 fitcknn을 사용하여 k-최근접이웃 모델을 훈련시키면 유연성을 높일 수 있습니다. 훈련 후에는 모델과 예측 변수 데이터를 predict에 전달하여 레이블을 예측하거나 사후 확률을 추정합니다.

분류 학습기머신러닝 지도 학습을 사용하여 데이터를 분류하도록 모델 훈련시키기

블록

ClassificationKNN PredictClassify observations using nearest neighbor classification model (R2022b 이후)

함수

모두 확장

fitcknnk-최근접이웃 분류기 피팅
ExhaustiveSearcherCreate exhaustive nearest neighbor searcher
KDTreeSearcherCreate Kd-tree nearest neighbor searcher
hnswSearcherHierarchical Navigable Small Worlds (HNSW) approximate nearest neighbor search (R2024a 이후)
creatensCreate nearest neighbor searcher object
limeLocal interpretable model-agnostic explanations (LIME) (R2020b 이후)
partialDependenceCompute partial dependence (R2020b 이후)
permutationImportancePredictor importance by permutation (R2024a 이후)
plotPartialDependenceCreate partial dependence plot (PDP) and individual conditional expectation (ICE) plots
shapleyShapley values (R2021a 이후)
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
lossLoss of k-nearest neighbor classifier
resubLossResubstitution classification loss
compareHoldoutCompare accuracies of two classification models using new data
edgeEdge of k-nearest neighbor classifier
marginMargin of k-nearest neighbor classifier
resubEdgeResubstitution classification edge
resubMarginResubstitution classification margin
testckfoldCompare accuracies of two classification models by repeated cross-validation
predictPredict labels using k-nearest neighbor classification model
resubPredictClassify training data using trained classifier
gatherGather properties of Statistics and Machine Learning Toolbox object from GPU (R2020b 이후)
pdist관측값 쌍 간의 쌍별(Pairwise) 거리
pdist2두 관측값 세트 간의 쌍별(Pairwise) 거리

객체

모두 확장

ClassificationKNNk-최근접이웃 분류
ClassificationPartitionedModelCross-validated classification model

도움말 항목

관련 정보