StepclassV2
逐步判别分析的主函数
用于分类
[sel,c,c0,re,P]=StepclaassV2(data,[50 50 50],data,10)
输入变量
x为训练集.每行为一个样本,每列为一个变量.
Class_x,为训练集的分类情况,一行,为各类样本数量,例如[5 6 9]
Test为待分类样本.
输出变量:sel为选择的变量序号,c,c0为拟合出的判别函数.re为对Test的判别结果,P为其后验概率.
author 王新 2012.4.8
例子Sample:
load fisheriris
x=meas
Class_x=[50,50,50]
Test=meas(1:5,:)
Fa1=4
[sel,c,c0,re,P]=StepclaassV2(x,Class_x,Test,Fa1)( Stepwise discriminant analysis for the classification of the main function [sel, c, c0, re, P] = StepclaassV2 (data, [50 50 50], data, 10) input variables x as the training set, each conduct a sample of each as a variable. Class_x, the classification for the training set, a row, the number of samples for all types, for example, [5 6 9] Test sample to be classified. output variable: sel for the selected variables serial number, c, c0 is fitted discriminant function. re discrimination results for the Test, P its posterior probability. author Wang 2012.4.8 examples Sample: load fisheriris x = meas Class_x = [50,50,50] Test = meas (1:5, :) Fa1 = 4 [sel, c, c0, re, P] = StepclaassV2 (x, Class_x, Test, Fa1))
- 2020-09-18 12:27:56下载
- 积分:1