liyanghua / principal-component-analysis- Goto Github PK
View Code? Open in Web Editor NEWPCA implementation in c++
PCA implementation in c++
A simple implementation of pca(Principal Components Analysis) please refer to the paper: http://www.cs.otago.ac.nz/cosc453/student_tutorials/principal_components.pdf for more details about pca. The implementation uses the example data in the paper above. To run the program, you must install TNT first. Please download TNT and JAMA from: http://math.nist.gov/tnt/download.html After you donwload it, please modify the Makefile . How to run: cd your_path_to_pca. ./make ./pca test_data
Hey! I think there is a little error which I have shown below. Let me know what you think.
// restore the old data
// final_data = RowFeatureVector * RowDataAdjust
Array2D<double> final_data(row, col);
Array2D<double> transpose_data(col, row);
transpose(d, transpose_data);
multiply(eigenvector, transpose_data, final_data);
In the above code, you are basically projecting your data to the basis formed by eigen vectors. Now, this could very well have been a sub-space formed by some of the eigen vectors.
The line where you do a multiplication, the final_data should have been declared as final_data(col, row) and then a transpose should be taken. Or you could have multiplies the original data with the transpose of the eigen_vectors.
If the error is still not clear, you can try reconstructing your original data and check if it matches with the original adjusted data.
Best
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.