주요 콘텐츠

모델 개발과 평가

합성 데이터 생성, 특징 선택, 특징 엔지니어링, 모델 선택, 하이퍼파라미터 최적화, 교차 검증, 잔차 진단, 플롯

고품질 회귀 모델을 개발하는 경우 적합한 특징(또는 예측 변수)을 선택하고, 하이퍼파라미터(데이터에 피팅되지 않는 모델 모수)를 조율하고, 잔차 진단을 통해 모델 가정을 평가해야 합니다. 하이퍼파라미터의 값을 선택하고 선택한 값을 사용하여 모델에 대한 교차 검증을 반복하는 방식으로 하이퍼파라미터를 조율할 수 있습니다. 이 과정을 통해 여러 개의 모델이 생성되며, 이러한 모델 중에서 가장 적합한 모델이 추정된 일반화 오차를 최소화하는 모델일 수 있습니다.

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

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

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

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

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

  • 하이퍼파라미터 값을 선택하고 그러한 값을 사용해 모델을 교차 검증하여 특정 모델의 하이퍼파라미터를 조정합니다. 예를 들어, SVM 모델을 조정하려면 상자 제약 조건과 커널 스케일의 집합을 선택하고, 값의 쌍 각각에 대해 모델을 교차 검증한 후 10겹 교차 검증된 평균제곱오차 추정값과 비교하십시오. 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 이후)
fsrftestUnivariate feature ranking for regression using F-tests
fsrmrmrRank features for regression using minimum redundancy maximum relevance (MRMR) algorithm (R2022a 이후)
fsrncaFeature selection using neighborhood component analysis for regression
oobPermutedPredictorImportanceOut-of-bag predictor importance estimates for random forest of regression trees by permutation
partialDependenceCompute partial dependence
permutationImportancePredictor importance by permutation (R2024a 이후)
plotPartialDependenceCreate partial dependence plot (PDP) and individual conditional expectation (ICE) plots
predictorImportanceEstimates of predictor importance for regression tree
predictorImportanceEstimates of predictor importance for regression 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
stepwiselmPerform stepwise regression
stepwiseglmCreate generalized linear regression model by stepwise regression
genrfeaturesPerform automated feature engineering for regression (R2021b 이후)
describeDescribe generated features (R2021a 이후)
transformTransform new data using generated features (R2021a 이후)
fitrautoAutomatically select regression 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교차 검증을 위한 훈련 인덱스

시계열 데이터의 경우

tspartitionPartition time series data for cross-validation (R2022b 이후)
testTest indices for time series cross-validation (R2022b 이후)
trainingTraining indices for time series cross-validation (R2022b 이후)

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
coefCIConfidence intervals of coefficient estimates of linear regression model
coefTestLinear hypothesis test on linear regression model coefficients
dwtestDurbin-Watson test with linear regression model object
plotScatter plot or added variable plot of linear regression model
plotAddedAdded variable plot of linear regression model
plotAdjustedResponseAdjusted response plot of linear regression model
plotDiagnosticsPlot observation diagnostics of linear regression model
plotEffectsPlot main effects of predictors in linear regression model
plotInteractionPlot interaction effects of two predictors in linear regression model
plotResidualsPlot residuals of linear regression model
plotSlicePlot of slices through fitted linear regression surface
coefCIConfidence intervals of coefficient estimates of generalized linear regression model
coefTestLinear hypothesis test on generalized linear regression model coefficients
devianceTestAnalysis of deviance for generalized linear regression model
plotDiagnosticsPlot observation diagnostics of generalized linear regression model
plotResidualsPlot residuals of generalized linear regression model
plotSlicePlot of slices through fitted generalized linear regression surface
coefCIConfidence intervals of coefficient estimates of nonlinear regression model
coefTestLinear hypothesis test on nonlinear regression model coefficients
plotDiagnosticsPlot diagnostics of nonlinear regression model
plotSlicePlot of slices through fitted nonlinear regression surface
linhyptestLinear hypothesis test

객체

모두 확장

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

도움말 항목

회귀 학습기 앱 워크플로

특징 선택

특징 엔지니어링

  • Automated Feature Engineering for Regression
    Use genrfeatures to engineer new features before training a regression model. Before making predictions on new data, apply the same feature transformations to the new data set.

자동 모델 선택

하이퍼파라미터 최적화

교차 검증

모델 해석

불확실성 추정

선형 모델 진단

  • 선형 회귀 결과 해석하기
    선형 회귀 결과 출력되는 통계량을 표시하고 해석합니다.
  • 선형 회귀
    선형 회귀 모델을 피팅하고 결과를 검토합니다.
  • Linear Regression with Interaction Effects
    Construct and analyze a linear regression model with interaction effects and interpret the results.
  • Summary of Output and Diagnostic Statistics
    Evaluate a fitted model by using model properties and object functions.
  • F-통계량과 t-통계량
    선형 회귀에서 F-통계량은 모델 또는 모델 성분의 유의성을 검정하는 분산분석(ANOVA) 방식에 대한 검정 통계량입니다. t-통계량은 회귀 계수에 대한 추론을 할 때 유용합니다.
  • 결정계수(R 제곱)
    결정계수(R 제곱)는 선형 회귀 모델에서 독립 변수 X로 설명되는 응답 변수 y의 비례적인 변동량을 나타냅니다.
  • 계수 표준 오차 및 신뢰구간
    추정된 계수 분산 및 공분산은 회귀 계수 추정값의 정밀도를 캡처합니다.
  • Residuals
    Residuals are useful for detecting outlying y values and checking the linear regression assumptions with respect to the error term in the regression model.
  • Durbin-Watson Test
    The Durbin-Watson test assesses whether or not there is autocorrelation among the residuals of time series data.
  • 쿡의 거리
    쿡의 거리(Cook’s Distance)는 X 값(예측 변수에 대한 관측값)에서 이상값을 식별하는 데 유용합니다.
  • Hat Matrix and Leverage
    The hat matrix provides a measure of leverage.
  • Delete-1 Statistics
    Delete-1 change in covariance (CovRatio) identifies the observations that are influential in the regression fit.

일반화 선형 모델 진단

  • Generalized Linear Models
    Generalized linear models use linear methods to describe a potentially nonlinear relationship between predictor terms and a response variable.

비선형 모델 진단

  • Nonlinear Regression
    Parametric nonlinear models represent the relationship between a continuous response variable and one or more continuous predictor variables.