Add -log10(pvalue) row to onehot-columns.npy output from slicenumpy.
[lightning.git] / slice_test.go
index 74e0e34519948b55ec03d658b284411273eef55f..8af51614ae430493faaa588509097b056bbdc63d 100644 (file)
@@ -352,6 +352,26 @@ pipeline1dup/input2        0
                                0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7,
                        })
                }
+
+               f, err = os.Open(npydir + "/onehot-columns.npy")
+               c.Assert(err, check.IsNil)
+               defer f.Close()
+               npy, err = gonpy.NewReader(f)
+               c.Assert(err, check.IsNil)
+               c.Check(npy.Shape, check.DeepEquals, []int{8, 5})
+               onehotcols, err := npy.GetInt32()
+               if c.Check(err, check.IsNil) {
+                       for r := 0; r < npy.Shape[0]; r++ {
+                               c.Logf("%v", onehotcols[r*npy.Shape[1]:(r+1)*npy.Shape[1]])
+                       }
+                       c.Check(onehotcols, check.DeepEquals, []int32{
+                               0, 0, 1, 4, 4, 4, 6, 6,
+                               2, 3, 2, 2, 3, 4, 2, 3,
+                               0, 1, 0, 0, 0, 0, 0, 0,
+                               157299, 157299, 157299, 157299, 157299, 157299, 157299, 157299,
+                               803273, 803273, 803273, 803273, 803273, 803273, 803273, 803273,
+                       })
+               }
        }
 }