Simple principal component analysis. The first time I saw PCA, my understanding was to try to describe the data in less dimensions to achieve the desired (though not the best, but ' cost-effective ' highest) effect.
clear;% parameter initialization inputfile = ' F:\Techonolgoy\MATLAB\file\MTALAB data analysis and Mining \datasets\chapter4\chapter4\ sample program \ Data\principal_component.xls '; outputfile = ' F:\Techonolgoy\MATLAB\file\MTALAB data analysis and mining \4\dimention_reducted.xls ' ;p roporition = 0.95;%% data read [num,~] = Xlsread (inputfile); principal component analysis [coeff,~,latent] = PCA (num); %coeff Each column is a feature vector, latent calculates the cumulative contribution for the corresponding eigenvalues, confirming the dimension sum_latent = Cumsum (latent/sum (latent)); % Cumulative contribution dimension = Find (sum_latent>proporition);d imension = dimension (1); reduced dimension data = Num*coeff (:, 1:dimension); Xlswrite (outputfile,data);d ISP (' principal component feature root: ');d ISP (latent ');d ISP (' principal component Unit feature vector: ');d ISP (' cumulative contribution ');d ISP (Sum_latent '); DISP ([' principal component analysis completed, reduced dimension data in ' outputfile] ')% Hallelujah load Handelsound (Y,FS)
Also, running to the end will play an exciting song ha!
MATLAB component Analysis (PCA)