资源简介
基于极限学习机的不平衡数据集分类,性能极好,且速度较快
代码片段和文件信息
function [TestingAccuracytest_gmean] = Simplified_LSSVM(TrainingData_File TestingData_Filesigma2C)
%%%%%%%%%%% Load training file
TrainDataArray = load (TrainingData_File);
T = TrainDataArray(:size(TrainDataArray2));
Y = TrainDataArray(:1:size(TrainDataArray2) - 1);
train_data = [T Y];
clear TrainDataArray;
%%%%%%%%%%% Load testing file
TestDataArray = load (TestingData_File);
T = TestDataArray(:size(TestDataArray2));
Y = TestDataArray(:1:size(TestDataArray2) - 1);
test_data = [T Y];
clear TestDataArray;
%%%%%%%%%%% Load training dataset
%train_data = load(TrainingData_File);
T=train_data(:1)‘;
P=train_data(:2:size(train_data2))‘;
clear train_data; % Release raw training data array
%%%%%%%%%%% Load testing dataset
%test_data = load( TestingData_File );
TV.T=test_data(:1)‘;
TV.P=test_data(:2:size(test_data2))‘;
clear test_data; % Release raw testing data array
NumberofTrainingData=size(P2);
NumberofTestingData=size(TV.P2);
%NumberofInputNeurons=size(P1);
%%%%%%%%%%%% Preprocessing the data of classification
sorted_target=sort(cat(2TTV.T)2);
label=zeros(11); % Find and save in ‘label‘ class label from training and testing data sets
label(11)=sorted_target(11);
j=1;
for i = 2:(NumberofTrainingData+NumberofTestingData)
if sorted_target(1i) ~= label(1j)
j=j+1;
label(1j) = sorted_target(1i);
end
end
number_class = j;
NumberofOutputNeurons = number_class;
%%%%%%%%%% Processing the targets of training
temp_T=zeros(NumberofOutputNeurons NumberofTrainingData);
for i = 1:NumberofTrainingData
for j = 1:number_class
if label(1j) == T(1i)
break;
end
end
temp_T(ji)=1;
end
T = temp_T * 2 - 1;
%%%%%%%%%% Processing the targets of testing
temp_TV_T=zeros(NumberofOutputNeurons NumberofTestingData);
for i = 1:NumberofTestingData
for j = 1:number_class
if label(1j) == TV.T(1i)
break;
end
end
temp_TV_T(ji)=1;
end
TV.T = temp_TV_T * 2 - 1;
% end if of Elm_Typ
%%%%%%%%%%% Calculate weights & biases
% start_time_train=cputime;
tic;
n = size(T2);
Omega_train = kernel_matrix(P‘‘RBF_kernel‘ sigma2);
%OutputWeight = ( ( W * Omega_train + speye(n)/C ) \ ( W * T‘ ) );
OutputWeight = ( ( Omega_train + speye(n)/C ) \ ( T‘ ) );
%OutputWeight=mtimesx(H((mtimesx(H‘H)+speye(n)/C)\T‘));
%OutputWeight=inv(H * H‘) * H * T‘; % faster implementation
% end_time_train=cputime;
% TrainingTime=end_time_train-start_time_train ; % Calculate CPU time (seconds) spent for training ELM
%TrainingTime=toc;
%%%%%%%%%%% Calculate the training accu
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2536 2013-06-24 09:37 kernel_matrix.m
文件 1325 2013-06-28 13:42 TEST_kernel_imbalance.m
文件 899 2013-06-26 19:15 TestELM_kernel.m
文件 4896 2013-06-28 09:53 ELM_kernel.m
----------- --------- ---------- ----- ----
9656 4
- 上一篇:图像显著性检测算法
- 下一篇:OMP、SP、IRLS、CoSaMP等重构算法
相关资源
- 三相不平衡配电网的潮流计算
- PNN,smote,BP-AdaBoost等类别不平衡分类
- STATCOM无功补偿不平衡负载,阶梯调制
- ELM_kernel 核极限学习机
- BlurKernelEstimation 模糊图像去模糊处理
- LVRT 不平衡条件下的逆变器低穿运行
- software phase locked loop 准确检测到基波
- 核函数的ELM算法
- elm_kernel_trainapredict Kernel_ELM传说中的核
- Elm_KElm Elm和KernelElm算法matlab实现
- qiantuihuidai_method 前推回代法求解三相
- kfcm
- elm_kernel ELM 极限学习机的核函数 MAT
- threelever3p4wzb 三电平三相四线制APF
- SVM and Kernel Methods Matlab Toolbox
评论
共有 条评论