protected PrincipalComponentAnalysisReduction(AnalysisMethod method, int numberOfOutputs, InternalPrincipalComponentAnalysis pca, Preprocessor predecessor) : base(predecessor) { this.method = method; this.numberOfOutputs = numberOfOutputs; this.pca = pca; }
public P Train <P>(List <ISample> trainingSamples) where P : Preprocessor { this.pca = new InternalPrincipalComponentAnalysis((PrincipalComponentMethod)method, numberOfOutputs: numberOfOutputs, whiten: true); double[][] data = trainingSamples.Select(sample => sample.GetDimensions()).ToArray(); pca.Learn(data); return(this as P); }