O'Reilly logo

C# Machine Learning Projects by Yoon Hyup Hwang

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Dimensionality reduction by PCA

We saw that many of our feature or pixel values are 0, when we were analyzing our data. In such cases, applying PCA can be helpful for reducing the dimensions of the data, while minimizing the loss of information from the reduced dimensions. Simply put, PCA is used to explain a dataset and its structure through linear combinations of the original features. So, each principal component is a linear combination of the features. Let's start looking at how we can run PCA in C#, using the Accord.NET framework.

The following is how you can initialize and train a PCA:

var pca = new PrincipalComponentAnalysis(    PrincipalComponentMethod.Standardize);pca.Learn(data);

Once a PrincipalComponentAnalysis is trained with the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required