MATLAB component Analysis (PCA)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.