주요 콘텐츠

모델 개발과 평가

합성 데이터 생성, 특징 선택, 특징 엔지니어링, 모델 선택, 하이퍼파라미터 최적화, 교차 검증, 예측 성능 평가, 분류 정확도 비교 테스트

고품질 예측 분류 모델을 개발하는 경우 적합한 특징(또는 예측 변수)을 선택하고 하이퍼파라미터(추정되지 않은 모델 모수)를 조율해야 합니다. 특징 선택과 하이퍼파라미터 조율을 통해 여러 모델이 생성될 수 있습니다. 모델 간 k겹 오분류율, ROC(수신자 조작 특성) 곡선 또는 혼동 행렬을 비교할 수 있습니다. 또는, 통계 검정을 수행하여 어떠한 분류 모델이 다른 모델보다 성능이 훨씬 더 뛰어난지 여부를 파악할 수 있습니다.

다음 작업을 수행하여 분류 모델을 만들고 평가할 수 있습니다.

  • 분류 모델을 훈련시키기 전에 synthesizeTabularData 또는 binningTabularSynthesizer를 사용하여 기존 데이터 세트에서 합성 데이터를 생성합니다.

  • 분류 모델을 훈련시키기 전에 gencfeatures를 사용하여 새로운 특징을 엔지니어링합니다.

  • 분류 학습기 앱을 사용하여 대화형 방식으로 분류 모델을 만들고 평가합니다.

  • fitcauto를 사용하여, 조정된 하이퍼파라미터를 가진 모델을 자동으로 선택합니다. 이 함수는 다양한 하이퍼파라미터 값으로 분류 모델 유형을 선택해 보고 새 데이터에서 잘 수행될 것으로 예상되는 최종 모델을 반환합니다. 어떤 분류기 유형이 데이터에 가장 적합한지 확신하지 못할 경우 fitcauto를 사용하십시오.

  • 하이퍼파라미터 값을 선택하고 그러한 값을 사용해 모델을 교차 검증하여 특정 모델의 하이퍼파라미터를 조정합니다. 예를 들어, SVM 모델을 조정하려면 상자 제약 조건과 커널 스케일의 집합을 선택하고, 값의 쌍 각각에 대해 모델을 교차 검증하십시오. Statistics and Machine Learning Toolbox™에서 제공되는 특정 분류 함수는 베이즈 최적화, 그리드 탐색 또는 임의 탐색을 통해 자동 하이퍼파라미터 조율 기능을 제공합니다. 베이즈 최적화를 구현하는 메인 함수 bayesopt는 여러 다른 응용 사례에 사용할 수 있을 정도로 유연합니다. Bayesian Optimization Workflow 항목을 참조하십시오.

  • lime, shapley, plotPartialDependence를 사용하여 분류 모델을 해석합니다.

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

함수

모두 확장

synthesizeTabularDataSynthesize tabular data (R2024b 이후)
binningTabularSynthesizerBinning-based synthesizer for tabular data synthesis (R2024b 이후)
synthesizeTabularDataSynthesize tabular data using binning-based synthesizer (R2024b 이후)
mmdtestTwo-sample multivariate hypothesis test using maximum mean discrepancy (MMD) (R2024b 이후)
knntestTwo-sample multivariate hypothesis test using k-nearest neighbors (KNN) (R2025a 이후)
fscchi2Univariate feature ranking for classification using chi-square tests
fscmrmrRank features for classification using minimum redundancy maximum relevance (MRMR) algorithm
fscncaFeature selection using neighborhood component analysis for classification
oobPermutedPredictorImportanceOut-of-bag predictor importance estimates for random forest of classification trees by permutation
permutationImportancePredictor importance by permutation (R2024a 이후)
predictorImportanceEstimates of predictor importance for classification tree
predictorImportanceEstimates of predictor importance for classification ensemble of decision trees
relieffRank importance of predictors using ReliefF or RReliefF algorithm
selectFeaturesSelect important features for NCA classification or regression (R2023b 이후)
sequentialfsSequential feature selection using custom criterion
gencfeaturesPerform automated feature engineering for classification (R2021a 이후)
describeDescribe generated features (R2021a 이후)
transformTransform new data using generated features (R2021a 이후)
fitcautoAutomatically select classification model with optimized hyperparameters
bayesoptSelect optimal machine learning hyperparameters using Bayesian optimization
hyperparametersVariable descriptions for optimizing a fit function
optimizableVariablebayesopt 또는 기타 최적화 함수에 대한 변수 설명
learnersizeCompact size of trained machine learning model object (R2024b 이후)
plotPlot aggregated hyperparameter optimization results (R2024b 이후)
resumeResume hyperparameter optimization problems (R2024b 이후)
summarySummary table for AggregateBayesianOptimization object (R2024b 이후)
crossvalEstimate loss using cross-validation
cvpartition교차 검증을 위한 데이터 분할
repartitionRepartition data for cross-validation
summarySummarize cross-validation partition with stratification or grouping variable (R2025a 이후)
test교차 검증을 위한 테스트 인덱스
training교차 검증을 위한 훈련 인덱스

LIME(Local Interpretable Model-Agnostic Explanations)

limeLocal interpretable model-agnostic explanations (LIME)
fitFit simple model of local interpretable model-agnostic explanations (LIME)
plotPlot results of local interpretable model-agnostic explanations (LIME)

섀플리 값

shapleyShapley values (R2021a 이후)
fitCompute Shapley values for query points (R2021a 이후)
plotPlot Shapley values using bar graphs (R2021a 이후)
boxchartVisualize Shapley values using box charts (box plots) (R2024a 이후)
plotDependencePlot dependence of Shapley values on predictor values (R2024b 이후)
swarmchartVisualize Shapley values using swarm scatter charts (R2024a 이후)

부분 종속성

partialDependenceCompute partial dependence
plotPartialDependenceCreate partial dependence plot (PDP) and individual conditional expectation (ICE) plots

혼동행렬

confusionchartCreate confusion matrix chart for classification problem
confusionmat분류 문제에 대한 혼동행렬 계산

ROC(수신자 조작 특성) 곡선

rocmetricsReceiver operating characteristic (ROC) curve and performance metrics for binary and multiclass classifiers (R2022a 이후)
addMetricsCompute additional classification performance metrics (R2022a 이후)
aucArea under ROC curve or precision-recall curve (R2024b 이후)
average다중클래스 문제에서 평균 ROC(수신자 조작 특성) 곡선에 대한 성능 메트릭 계산 (R2022a 이후)
modelOperatingPointOperating point of rocmetrics object (R2024b 이후)
plotPlot receiver operating characteristic (ROC) curves and other performance curves (R2022a 이후)
perfcurve분류기 출력값에 대한 ROC(수신자 조작 특성) 곡선 또는 기타 성능 곡선
testcholdoutCompare predictive accuracies of two classification models
testckfoldCompare accuracies of two classification models by repeated cross-validation

객체

모두 확장

FeatureSelectionNCAClassificationFeature selection for classification using neighborhood component analysis (NCA)
FeatureTransformerGenerated feature transformations (R2021a 이후)
BayesianOptimizationBayesian optimization results
HyperparameterOptimizationOptionsHyperparameter optimization options (R2024b 이후)
AggregateBayesianOptimizationAggregate Bayesian optimization results (R2024b 이후)

속성

ConfusionMatrixChart PropertiesConfusion matrix chart appearance and behavior
ROCCurve PropertiesReceiver operating characteristic (ROC) curve appearance and behavior (R2022a 이후)

도움말 항목

분류 학습기 앱

특징 선택

특징 엔지니어링

자동 모델 선택

하이퍼파라미터 최적화

모델 해석

교차 검증

분류 성능 평가