Beispiel #1
0
 public ISample ApplyTransform(ISample sample)
 {
     int[] columns = GetColumns();
     if (columns.Length >= 0 && columns.Where(i => i > sample.GetColumnCount() - 1 || i < 0).Count() > 0)
     {
         throw new ArgumentException("Provided columns must be a number between 0 and the total number of columns minus one");
     }
     return(sample.AcceptVisitor(new SampleDataVisitor(GetTransformedRows(sample, GetAppliedColumns(columns, sample.GetColumnCount())), RecalculateDuration())));
 }
Beispiel #2
0
        public ISample GetSubset()
        {
            List <Tuple <double, double[]> > subsetRows = new List <Tuple <double, double[]> >(new Tuple <double, double[]> [baseSample.GetDataRows().Count]);

            for (int i = 0; i < baseSample.GetDataRows().Count; i++)
            {
                subsetRows[i] = new Tuple <double, double[]>(baseSample.GetDataRows()[i].Item1, subset[i].ToArray());
            }
            return(baseSample.AcceptVisitor <ISample>(new SampleDataVisitor(subsetRows, false)));
        }
Beispiel #3
0
 public ISample Extract(ISample sample)
 {
     return(sample.AcceptVisitor <ISample>(new SampleDataVisitor(ExtractRows(sample), RecalculateDuration())));
 }
 public ISample ApplyReduction(ISample sample)
 {
     return(sample.AcceptVisitor(new SampleDataVisitor(GetReducedDimensions(sample), false)));
 }