本页对应的英文页面已更新,但尚未翻译。 若要查看最新内容,请点击此处访问英文页面。

广义线性回归

用于有限响应的回归模型

为了提高在中低维数据集上的准确度并增加联系函数选择,可以使用 fitglm 拟合广义线性模型。

为了减少在高维数据集上的计算时间,可以使用 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

函数

fitglmCreate generalized linear regression model
stepwiseglmCreate generalized linear regression model by stepwise regression
compactCompact generalized linear regression model
dispDisplay generalized linear regression model
fevalEvaluate generalized linear regression model prediction
predictPredict response of generalized linear regression model
randomSimulate responses for generalized linear regression model
fitclinearFit linear classification model to high-dimensional data
templateLinearLinear classification learner template
fitcecocFit multiclass models for support vector machines or other classifiers
predictPredict labels for linear classification models
fitckernelFit Gaussian kernel classification model using random feature expansion
predictPredict labels for Gaussian kernel classification model
mnrfitMultinomial logistic regression
mnrvalMultinomial logistic regression values
glmfitGeneralized linear model regression
glmvalGeneralized linear model values
plotPartialDependenceCreate partial dependence plot (PDP) and individual conditional expectation (ICE) plots

示例和操作指南

Generalized Linear Model Workflow

Fit a generalized linear model and analyze the results.

Train Logistic Regression Classifiers Using Classification Learner App

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

使用广义线性模型拟合数据

此示例说明如何使用 glmfitglmval 来拟合和计算广义线性模型。普通线性回归可用于将直线或具有线性参数的函数与具有正态分布误差的数据相拟合。这是最常用的回归模型,但并非总是符合实际需要。广义线性模型通过两种方式对线性模型进行扩展。首先,通过引入联系函数,放宽了参数的线性假设。其次,可以对正态分布之外的误差分布进行建模。

逻辑回归模型的贝叶斯分析

此示例说明如何使用 slicesample 对逻辑回归模型进行贝叶斯推断。

概念

Generalized Linear Models

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

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.

Wilkinson Notation

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