Main Content

分类划分类别

超类:紧凑型歧视

判别分析分类

description

一个ClassificationDiscriminant对象封装了判别分析分类器,这是用于数据生成的高斯混合模型。一个ClassificationDiscriminantOBJect can predict responses for new data using the预测方法。该对象包含用于培训的数据,因此可以计算重新定义预测。

建造

创建一个ClassificationDiscriminantOBJect by usingfitcdiscr

properties

赌博

p-by-p矩阵,阶层之间的协方差,其中p是预测变量的数量。

CategoricalPredictors

分类预测指标,总是空的([[这是给予的)。

classNames

培训数据中的元素列表y删除了重复项。classNamescan be a categorical array, cell array of character vectors, character array, logical vector, or a numeric vector.classNameshas the same data type as the data in the argumenty(该软件将字符串阵列视为字符向量的单元格数组。)

Coeffs

k-by-kstructure of coefficient matrices, wherek是类的数量。系数(i,j)包含类之间线性或二次边界的系数一世j。Fields in系数(i,j)

  • d一世scrimType

  • Class1-classNames((一世)

  • class2-classNames((j)

  • const- 标量

  • 线性-一个vector withp组件,哪里p是列中的数量X

  • 二次-p-by-p矩阵,存在于二次d一世scrimType

这equation of the boundary between class一世和classj

const+线性*X+X'*二次*X=0,,,,

在哪里X是长度的列矢量p

如果fitcdiscrFillCoeffsname-value pair set to'的f'构造分类器时Coeffs是空的 ([[这是给予的)。

Cost

方形矩阵,哪里费用(i,j)是将要点分类的成本j一世f its true class is一世(即,行对应于真实类,列对应于预测类)。行的顺序和列的顺序Cost对应于类的顺序classNames。这number of rows and columns inCost是个number of unique classes in the response.

更改Costmatrix using dot notation:obj.cost = costmatrix

三角洲

线性判别模型(非负标量)的增量阈值的值。如果系数OBJ幅度小于三角洲,,,,OBJ将此系数设置为0,因此您可以从模型中消除相应的预测因子。放三角洲至a higher value to eliminate more predictors.

三角洲一定是0用于二次判别模型。

Change三角洲using dot notation:obj.delta = newdelta

Deltapredictor

长度为长度等于预测变量的行OBJ。如果deltapredicor(i)然后系数一世该模型是0

如果OBJ是a quadratic discriminant model, all elements ofDeltapredictor0

d一世scrimType

Character vector specifying the discriminant type. One of:

  • “线性”

  • 'quadratic'

  • 'diagLinear'

  • diagquadratic'

  • “伪线”

  • “伪Quadratic”

Changed一世scrimTypeusing dot notation:obj.discrimtype = newdiscrimtype

您可以在线性类型或二次类型之间进行更改,但不能在线性和二次类型之间更改。

Gamma

Value of the Gamma regularization parameter, a scalar from01。ChangeGammausing dot notation:OBJ。Gamma = newGamma

  • 如果您设置1for linear discriminant, the discriminant sets its type to'diagLinear'

  • 如果您设置a value betweenMingamma1for linear discriminant, the discriminant sets its type to“线性”

  • you cannot set values below the value of theMingamma财产。

  • 对于二次判别,您可以设置0((ford一世scrimType'quadratic') 或者1((ford一世scrimTypediagquadratic')。

高参数临时化

超参数的交叉验证优化的描述,存储为一个贝叶斯式化对象或超参数和相关值的表。当优化缩放参数名称值对在创建方面是非空的。价值取决于设置高参数量像创建时的名称值对:

  • '贝叶斯'(默认) - 类的对象贝叶斯式化

  • 'GridSearch'或者'randomsearch'——hyperparameters表使用,观察目标e function values (cross-validation loss), and rank of observations from lowest (best) to highest (worst)

logdetsigma

课堂内协方差矩阵的决定因素的对数。类型logdetsigma取决于判别类型:

  • 线性判别分析标量

  • 长度的向量kfor quadratic discriminant analysis, wherek是类的数量

Mingamma

Nonnegative scalar, the minimal value of the Gamma parameter so that the correlation matrix is invertible. If the correlation matrix is not singular,Mingamma0

模型参数

培训中使用的参数OBJ

课堂手段,指定为k-by-p标量值类矩阵大小的平均值。k是类的数量,p是预测变量的数量。每一行represents the mean of the multivariate normal distribution of the corresponding class. The class indices are in theclassNames属性。

数字

训练数据中的观察数,数字标量。数字可能小于输入数据的行数Xwhen there are missing values inX或响应y

predictorNames

预测变量的名称的单元格数组,按照培训数据出现的顺序X

事先的

每个类的先验概率的数字向量。元素的顺序事先的对应于类的顺序classNames

一个dd or change a事先的使用点符号向量:obj.prior = priorvector

响应类型

Character vector describing the response variabley

ScoreTransform

角色向量表示内置转换函数或用于转换得分的函数句柄。'没有任何'意味着不转变;等效,'没有任何'means@(x)x。有关内置转换函数列表和自定义转换功能的语法,请参见fitcdiscr

我mplement dot notation to add or change aScoreTransform功能using one of the following:

  • cobj.scoretransform ='功能'

  • cobj.scoretransform = @功能

Sigma

课堂内协方差矩阵或矩阵。尺寸取决于d一世scrimType

  • “线性”(默认) - 大小的矩阵p-by-p,,,,在哪里p是个number of predictors

  • 'quadratic'- 大小的数组p-by-p-by-k,,,,在哪里k是类的数量

  • 'diagLinear'- 长的行矢量p

  • diagquadratic'- 大小的数组1-by-p-by-k

  • “伪线”- 大小的矩阵p-by-p

  • “伪Quadratic”- 大小的数组p-by-p-by-k

w

Scaled权重,,,,a vector with lengthn,,,,the number of rows inX

X

Matrix of predictor values. Each column ofX代表一个预测变量(变量),每行代表一个观察值。

XCentered

Xdata with class means subtracted. If义)是课堂j,,,,

XCenter(i,:)=X((一世,,,,:)-Mu(J,:),,,,

在哪里是个class mean property.

y

一个分类数组,字符向量的单元格数组,字符阵列,逻辑向量或数字向量与行相同数量的行X。每一行y表示相应行的分类X

对象功能

compact 紧凑的判别分析分类器
比较 Compare accuracies of two classification models using new data
杂交 交叉验证判别分析分类器
cvshrink 线性判别式的跨估量正规化
边缘 分类边缘
lime 局部可解释的模型不足解释(石灰)
logp Log unconditional probability density for discriminant analysis classifier
loss 分类错误
玛哈尔 Mahalanobis距离判别分析分类器的阶级手段
利润 Classification margins
nlinearcoeffs 非零线性系数的数量
partialdependence 计算部分依赖性
plotPartialDependence 创建部分依赖图(PDP)和个人条件期望(ICE)图
预测 predict labels using discriminant analysis classification model
重新组 分类边缘
重新公开 分类错误通过重述
resubMargin 通过重新确定的分类利润率
重新提高 预测判别分析分类模型的重述标签
沙普利 沙普利值
testckfold Compare accuracies of two classification models by repeated cross-validation

复制语义

价值。要了解价值类别如何影响复制操作,请参见复制对象

Examples

全部收缩

Load Fisher's iris data set.

加载渔业

train a discriminant analysis model using the entire data set.

MDL = FITCDISCR(MES,物种)
mdl = classificationDiscriminant响应名称:'y'分类器:[] classNames:{'setosa''versicolor''virginica''virginica'} scoretransform:'note'numobservations:150 indimtype:150 indiremtype:'linear'mu:'linear'mu:[3x4 double] coeffs:[3x4 double] coeffs:[3x3 struct:[3x3 struct]]]属性,方法

MDL是aClassificationDiscriminant模型。要访问其属性,请使用点表示法。例如,显示每个预测指标的组平均值。

mdl.mu
ans =3×45.0060 3.4280 1.4620 0.2460 5.9360 2.7700 4.2600 1.3260 6.5880 2.9740 5.5520 2.0260

要预测新观察的标签,请通过MDL并预测数据预测

更多关于

expand all

References

[1] Guo,Y.,T。Hastie和R. Tibshirani。“正则线性判别分析及其在微阵列中的应用。”Biostatistics,Vol. 8, No. 1, pp. 86–100, 2007.

Extended Capabilities

版本历史记录

在R2011b中引入