Ejemplo n.º 1
0
 def test_rdd_double_h2o_frame(self):
     hc = self._hc
     rdd = self._sc.parallelize([0.5, 1.3333333333, 178])
     h2o_frame = hc.as_h2o_frame(rdd)
     self.assertEquals(h2o_frame[0, 0], 0.5, "Value should match")
     self.assertEquals(h2o_frame[1, 0], 1.3333333333, "Value should match")
     test_utils.asert_h2o_frame(self, h2o_frame, rdd)
Ejemplo n.º 2
0
 def test_rdd_bool_to_h2o_frame(self):
     hc = self._hc
     rdd = self._sc.parallelize([True, False, True, True, False])
     h2o_frame = hc.as_h2o_frame(rdd)
     self.assertEquals(h2o_frame[0, 0], 1, "Value should match")
     self.assertEquals(h2o_frame[1, 0], 0, "Value should match")
     test_utils.asert_h2o_frame(self, h2o_frame, rdd)
Ejemplo n.º 3
0
 def test_rdd_str_h2o_frame(self):
     hc = self._hc
     rdd = self._sc.parallelize(["a", "b", "c"])
     h2o_frame = hc.as_h2o_frame(rdd)
     self.assertEquals(h2o_frame[0, 0], "a", "Value should match")
     self.assertEquals(h2o_frame[2, 0], "c", "Value should match")
     test_utils.asert_h2o_frame(self, h2o_frame, rdd)
Ejemplo n.º 4
0
 def test_rdd_int_h2o_frame(self):
     hc = self._hc
     rdd = self._spark.sparkContext.parallelize(
         [num for num in range(0, 100)])
     h2o_frame = hc.as_h2o_frame(rdd)
     self.assertEquals(h2o_frame[0, 0], 0, "Value should match")
     test_utils.asert_h2o_frame(self, h2o_frame, rdd)
Ejemplo n.º 5
0
 def test_rdd_double_h2o_frame(self):
     hc = self._hc
     rdd = self._spark.sparkContext.parallelize([0.5,1.3333333333,178])
     h2o_frame = hc.as_h2o_frame(rdd)
     self.assertEquals(h2o_frame[0,0],0.5,"Value should match")
     self.assertEquals(h2o_frame[1,0],1.3333333333,"Value should match")
     test_utils.asert_h2o_frame(self, h2o_frame, rdd)
Ejemplo n.º 6
0
 def test_rdd_str_h2o_frame(self):
     hc = self._hc
     rdd = self._spark.sparkContext.parallelize(["a","b","c"])
     h2o_frame = hc.as_h2o_frame(rdd)
     self.assertEquals(h2o_frame[0,0],"a","Value should match")
     self.assertEquals(h2o_frame[2,0],"c","Value should match")
     test_utils.asert_h2o_frame(self,h2o_frame,rdd)
Ejemplo n.º 7
0
 def test_rdd_bool_to_h2o_frame(self):
     hc = self._hc
     rdd = self._spark.sparkContext.parallelize([True, False, True, True, False])
     h2o_frame = hc.as_h2o_frame(rdd)
     self.assertEquals(h2o_frame[0,0],1,"Value should match")
     self.assertEquals(h2o_frame[1,0],0,"Value should match")
     test_utils.asert_h2o_frame(self,h2o_frame,rdd)
Ejemplo n.º 8
0
 def test_rdd_int_h2o_frame(self):
     hc = self._hc
     rdd = self._spark.sparkContext.parallelize([num for num in range(0,100)])
     h2o_frame = hc.as_h2o_frame(rdd)
     self.assertEquals(h2o_frame[0,0], 0, "Value should match")
     test_utils.asert_h2o_frame(self,h2o_frame,rdd)