Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

多元线性回归

具有多个预测变量的线性回归

为了提高在中低维数据集上的准确度,可以使用 fitlm 拟合线性回归模型。

为了减少在高维数据集上的计算时间,可以使用 fitrlinear 拟合线性回归模型。

App

回归学习器Train regression models to predict data using supervised machine learning

对象

LinearModelLinear regression model
CompactLinearModelCompact linear regression model
RegressionLinearLinear regression model for high-dimensional data
RegressionPartitionedLinearCross-validated linear regression model for high-dimensional data

函数

全部展开

创建 LinearModel 对象

fitlm拟合线性回归模型
stepwiselmPerform stepwise regression

创建 CompactLinearModel 对象

compactCompact linear regression model

添加或删除线性模型中的项

addTermsAdd terms to linear regression model
removeTermsRemove terms from linear regression model
stepImprove linear regression model by adding or removing terms

预测响应

fevalPredict responses of linear regression model using one input for each predictor
predictPredict responses of linear regression model
randomSimulate responses with random noise for linear regression model

计算线性模型

anovaAnalysis of variance for linear regression model
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
partialDependenceCompute partial dependence

可视化线性模型和汇总统计量

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
plotPartialDependenceCreate partial dependence plot (PDP) and individual conditional expectation (ICE) plots
plotResidualsPlot residuals of linear regression model
plotSlicePlot of slices through fitted linear regression surface

收集线性模型的属性

gatherGather properties of Statistics and Machine Learning Toolbox object from GPU

创建对象

fitrlinearFit linear regression model to high-dimensional data

使用 RegressionLinear 对象

predictPredict response of linear regression model
limeLocal interpretable model-agnostic explanations (LIME)
lossRegression loss for linear regression models
partialDependenceCompute partial dependence
plotPartialDependenceCreate partial dependence plot (PDP) and individual conditional expectation (ICE) plots
shapleyShapley values
selectModelsSelect fitted regularized linear regression models

使用 RegressionPartitionedLinear 对象

kfoldLossRegression loss for observations not used in training
kfoldPredictPredict responses for observations not used for training

拟合和计算线性回归

dwtestDurbin-Watson test with residual inputs
invpredInverse prediction
linhyptestLinear hypothesis test
plsregressPartial least-squares (PLS) regression
regress多元线性回归
regstatsRegression diagnostics
relieffRank importance of predictors using ReliefF or RReliefF algorithm
robustfitFit robust linear regression
stepwisefitFit linear regression model using stepwise regression

准备数据

x2fxConvert predictor matrix to design matrix
dummyvarCreate dummy variables

交互式工具

robustdemoInteractive robust regression
rsmdemoInteractive response surface demonstration
rstoolInteractive response surface modeling
stepwiseInteractive stepwise regression

主题

线性回归简介

线性回归工作流

偏最小二乘回归

  • Partial Least Squares
    Partial least squares (PLS) constructs new predictor variables as linear combinations of the original predictor variables, while considering the observed response values, leading to a parsimonious model with reliable predictive power.
  • 偏最小二乘回归和主成分回归
    应用偏最小二乘回归 (PLSR) 和主成分回归 (PCR),并研究这两种方法的有效性。