资源简介
Matlab代码 LDA分析,可以用作特征提取或者分类器
代码片段和文件信息
function [TrainingTime TestingTime TrainingAccuracy TestingAccuracylabel_index_actual] = elm(train_data train_label test_data test_label Elm_Type NumberofHiddenNeurons ActivationFunction)
% Usage: elm(TrainingData_File TestingData_File Elm_Type NumberofHiddenNeurons ActivationFunction)
% OR: [TrainingTime TestingTime TrainingAccuracy TestingAccuracy] = elm(TrainingData_File TestingData_File Elm_Type NumberofHiddenNeurons ActivationFunction)
%
% Input:
% train_data - Filename of training data set
% train_label - Label of training data set
% test_data - Filename of testing data set
% test_label - Label of testing data set
% Elm_Type - 0 for regression; 1 for (both binary and multi-classes) classification
% NumberofHiddenNeurons - Number of hidden neurons assigned to the ELM
% ActivationFunction - Type of activation function:
% ‘sig‘ for Sigmoidal function
% ‘sin‘ for Sine function
% ‘hardlim‘ for Hardlim function
% ‘tribas‘ for Triangular basis function
% ‘radbas‘ for Radial basis function (for additive type of SLFNs instead of RBF type of SLFNs)
%
% Output:
% TrainingTime - Time (seconds) spent on training ELM
% TestingTime - Time (seconds) spent on predicting ALL testing data
% TrainingAccuracy - Training accuracy:
% RMSE for regression or correct classification rate for classification
% TestingAccuracy - Testing accuracy:
% RMSE for regression or correct classification rate for classification
%
% MULTI-CLASSE CLASSIFICATION: NUMBER OF OUTPUT NEURONS WILL BE AUTOMATICALLY SET EQUAL TO NUMBER OF CLASSES
% FOR EXAMPLE if there are 7 classes in all there will have 7 output
% neurons; neuron 5 has the highest output means input belongs to 5-th class
%
% Sample1 regression: [TrainingTime TestingTime TrainingAccuracy TestingAccuracy] = elm(‘sinc_train‘ ‘sinc_test‘ 0 20 ‘sig‘)
% Sample2 classification: elm(‘diabetes_train‘ ‘diabetes_test‘ 1 20 ‘sig‘)
%
%%%%%%%%%%% Macro definition
REGRESSION=0;
CLASSIFIER=1;
%%%%%%%%%%% Load training dataset
T=train_label‘; % 训练数据的标签
P=train_data‘; % 训练数据
%%%%%%%%%%% Load testing dataset
TV.T=test_label‘; % 测试数据的标签
TV.P=test_data‘; % 测试数据
NumberofTrainingData=size(P2);
NumberofTestingData=size(TV.P2);
NumberofInputNeurons=size(P1);
if Elm_Type~=REGRESSION
%%%%%%%%%%%% 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_t
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-02-01 21:24 LDA\
文件 648938 2019-01-21 17:03 LDA\di_data.mat
文件 8676 2018-09-23 14:22 LDA\elm.m
文件 1652 2019-02-01 21:24 LDA\fit_big.asv
文件 1754 2019-02-01 21:28 LDA\fit_big.m
文件 8682 2019-01-28 10:46 LDA\LDA.m
- 上一篇:数字信号处理实验.zip
- 下一篇:matlab的方差分析
相关资源
- 降维技术matlab工具箱
- 1维的简单LDA和2维LDA人脸识别的matla
- LDA代码实现Matlab版
- LDA与PCA的讲解与matlab演示
- 二维LDA的matlab源代码
- PCA LDA LLE各种降维方法Matlab工具箱
- PLDA模型训练matlab代码
- Fisherface的原始论文和完整的源代码
- matlab实现LDA
- LDA详解及其matlab代码
- 模式识别PCA NMF LDA GMM算法代码
- LDA人脸识别matlab code
- LDA散度矩阵的计算
- 用LDA和PCA模式识别方法对人脸特征进
- LDA人脸识别MATLAB含k近邻算法
- LDA算法MATLAB代码及其结果截图
- LDA算法的matlab源代码
- fisher鉴别分析FLDAMatlab代码实现
- 线性判别分析matlab代码及pdf 讲解
- 基于fisher的线性判别分析(LDA)人脸
- 线性判别分析LDA算法代码
- fisher 线性判别分析matlab实现
- LDA,matlab实现
- MATLAB人脸识别PCALDAKPCABP,可视化界面
- PCA和LDA人脸识别matlab代码最紧邻分类
- LDA的matlab版本Latent Dirichlet Allocation
- MATLAB人脸识别PCALDAKPCABP,可视化界面
- LDA降维经典程序
- 基于LDA(fisherface)和KNN的人脸识别
- LDA线性判别分析人脸识别MATLAB代码/
评论
共有 条评论