Main Content




为了提高在中低维数据集上的准确度并增加联系函数选择,可以使用 fitglm 拟合广义线性回归模型。对于多项式逻辑回归,使用 mnrfit 拟合模型。

为了减少在高维数据集上的计算时间,可以使用 fitclinear 训练二类线性分类模型,例如逻辑回归模型。还可以使用 fitcecoc 高效地训练由逻辑回归模型组成的多类纠错输出编码 (ECOC) 模型。

对于大数据的非线性分类,可以使用 fitckernel 训练带逻辑回归的二类高斯核分类模型。



GeneralizedLinearModelGeneralized linear regression model class
CompactGeneralizedLinearModelCompact generalized linear regression model class
ClassificationLinearLinear model for binary classification of high-dimensional data
ClassificationECOCMulticlass model for support vector machines (SVMs) and other classifiers
ClassificationKernelGaussian kernel classification model using random feature expansion
ClassificationPartitionedLinearCross-validated linear model for binary classification of high-dimensional data
ClassificationPartitionedLinearECOCCross-validated linear error-correcting output codes model for multiclass classification of high-dimensional data



创建 GeneralizedLinearModel 对象

fitglmCreate generalized linear regression model
stepwiseglmCreate generalized linear regression model by stepwise regression

创建 CompactGeneralizedLinearModel 对象

compactCompact generalized linear regression model


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


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


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
partialDependenceCompute partial dependence


plotDiagnosticsPlot observation diagnostics of generalized linear regression model
plotPartialDependenceCreate partial dependence plot (PDP) and individual conditional expectation (ICE) plots
plotResidualsPlot residuals of generalized linear regression model
plotSlicePlot of slices through fitted generalized linear regression surface


gatherGather properties of Statistics and Machine Learning Toolbox object from GPU


fitclinearFit binary linear classifier to high-dimensional data
fitcecocFit multiclass models for support vector machines or other classifiers
fitckernelFit binary Gaussian kernel classifier using random feature expansion
templateLinearLinear classification learner template


predictPredict labels for linear classification models
predictClassify observations using multiclass error-correcting output codes (ECOC) model
predictPredict labels for Gaussian kernel classification model
mnrfitMultinomial logistic regression
mnrvalMultinomial logistic regression values
glmfitFit generalized linear regression model
glmvalGeneralized linear model values



Generalized Linear Models

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

Generalized Linear Model Workflow

Fit a generalized linear model and analyze the results.


使用 glmfitglmval 来拟合和计算广义线性模型。

Train Logistic Regression Classifiers Using Classification Learner App

Create and compare logistic regression classifiers, and export trained models to make predictions for new data.

Wilkinson Notation

Wilkinson notation provides a way to describe regression and repeated measures models without specifying coefficient values.


Multinomial Models for Nominal Responses

A nominal response variable has a restricted set of possible values with no natural order between them. A nominal response model explains and predicts the probability that an observation is in each category of a categorical response variable.

Multinomial Models for Ordinal Responses

An ordinal response variable has a restricted set of possible values that fall into a natural order. An ordinal response model describes the relationship between the cumulative probabilities of the categories and predictor variables.

Hierarchical Multinomial Models

A hierarchical multinomial response variable (also known as a sequential or nested multinomial response) has a restricted set of possible values that fall into hierarchical categories. The hierarchical multinomial regression models are extensions of binary regression models based on conditional binary observations.