zaharPonimash / cs-pca

Principal Component Analysis implemented in C#

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cs-pca

Principal Component Analysis implemented in C#

Install

Install-Package cs-pca

Usage

The sample codes below shows how to use the library to reduce the number of dimension or reconstruct the original data from the reduced data:

List<double[]> source = GetNormalizedData();
List<double[]> Z; // PCA output 
double variance_retained;
K = 5; // dimension of the Z (note that Z will have K+1 dimensions where the first dimension will be ignored)
PCA.PCADimReducer.CompressData(source, K, out Z, out variance_retained);

// To reconstruct some compressed data point from Z 
List<double[]> compressed_data_point = GetCompressedDataPoints(); // K+1 dimension data points 
List<double[]> uncompressed_data_point = ReconstructData(compressed_data_point, Z);

About

Principal Component Analysis implemented in C#

License:MIT License


Languages

Language:C# 100.0%