Ejemplo n.º 1
0
 public void TestGroupByDoubleKeyDoubleValueColumn()
 {
     float[,] tss = { { 0, 0, 0, 2, 2 }, { 2, 2, 2, 4, 4 }, { 0, 1, 2, 3, 4 }, { 1, 1, 1, 1, 1 } };
     using (KhivaArray arr = KhivaArray.Create(tss), groupBy = Regularization.GroupBy(arr, 0, 2, 2))
     {
         float[,] expected = { { 1, 3.5F }, { 1, 1 } };
         var result = groupBy.GetData2D <float>();
         Assert.AreEqual(expected, result);
     }
 }
Ejemplo n.º 2
0
 public void TestGroupBySingleColumn()
 {
     int[,] tss = { { 0, 1, 1, 2, 2, 3 }, { 0, 3, 3, 1, 1, 2 } };
     using (KhivaArray arr = KhivaArray.Create(tss), groupBy = Regularization.GroupBy(arr, 0))
     {
         int[] expected = { 0, 3, 1, 2 };
         var   result   = groupBy.GetData1D <int>();
         Assert.AreEqual(expected, result);
     }
 }