/// <summary> /// Constructs a new Principal Component Analysis. /// </summary> /// /// <param name="method">The analysis method to perform. Default is <see cref="AnalysisMethod.Center"/>.</param> /// <param name="whiten">Whether to whiten the results or not. If set to <c>true</c> the generatred output /// will be normalized to have unit standard deviation.</param> /// <param name="numberOfOutputs">The maximum number of components that the analysis will be able to project data into.</param> /// public PrincipalComponentAnalysis(PrincipalComponentMethod method = PrincipalComponentMethod.Center, bool whiten = false, int numberOfOutputs = 0) { this.Method = method; this.Whiten = whiten; this.NumberOfOutputs = numberOfOutputs; }
/// <summary> /// Constructs the Kernel Principal Component Analysis. /// </summary> /// /// <param name="kernel">The kernel to be used in the analysis.</param> /// <param name="method">The analysis method to perform.</param> /// <param name="centerInFeatureSpace">True to center the data in feature space, /// false otherwise. Default is true.</param> /// <param name="numberOfOutputs">The maximum number of components that the analysis will be able to project data into.</param> /// <param name="whiten">Whether to whiten the results or not. If set to <c>true</c> the generatred output /// will be normalized to have unit standard deviation.</param> /// public KernelPrincipalComponentAnalysis(IKernel kernel, PrincipalComponentMethod method = PrincipalComponentMethod.Center, bool centerInFeatureSpace = true, int numberOfOutputs = 0, bool whiten = false) { if (kernel == null) { throw new ArgumentNullException("kernel"); } this.Method = method; this.kernel = kernel; this.centerFeatureSpace = centerInFeatureSpace; this.NumberOfOutputs = numberOfOutputs; this.Whiten = whiten; }
public void runPCA() //DataTable mydt, List<string> numvars, string method, string subtitle) { if (_dt == null || _final_N == 0) { _subtitle += " *No data rows*"; _final_N = 0; } else { ////from http://accord-framework.net/docs/html/T_Accord_Statistics_Analysis_PrincipalComponentAnalysis.htm PrincipalComponentMethod mymethod = new PrincipalComponentMethod(); if (method == "Center") { mymethod = PrincipalComponentMethod.Center; } else if (method == "Standardize") { mymethod = PrincipalComponentMethod.Standardize; } var pca = new PrincipalComponentAnalysis() { Method = mymethod, Whiten = true }; // Learn the PCA projection using passing the cov matrix MultivariateLinearRegression transform = pca.Learn(_data); // Now, we can transform data as usual double[][] out1 = pca.Transform(_data); _pca = pca; buildPCAtable(); } }
public InternalPrincipalComponentAnalysis(PrincipalComponentMethod method = PrincipalComponentMethod.Center, bool whiten = false, int numberOfOutputs = 0) : base(method, whiten, numberOfOutputs) { }
public PrincipalComponentAnalyzer(PrincipalComponentMethod method = PrincipalComponentMethod.Svd) { Method = method; }