示例#1
0
 protected PrincipalComponentAnalysisReduction(AnalysisMethod method, int numberOfOutputs, InternalPrincipalComponentAnalysis pca, Preprocessor predecessor)
     : base(predecessor)
 {
     this.method          = method;
     this.numberOfOutputs = numberOfOutputs;
     this.pca             = pca;
 }
示例#2
0
        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);
        }