コード例 #1
0
 def _as_h2o_frame_from_dataframe(h2oContext,
                                  dataframe,
                                  frame_name,
                                  full_cols=100):
     j_h2o_frame = h2oContext._jhc.asH2OFrame(dataframe._jdf, frame_name)
     j_h2o_frame_key = j_h2o_frame.key()
     return H2OFrame.from_java_h2o_frame(j_h2o_frame, j_h2o_frame_key,
                                         full_cols)
コード例 #2
0
ファイル: conversions.py プロジェクト: h2oai/sparkling-water
 def _as_h2o_frame_from_complex_type(h2oContext, dataframe, frame_name, full_cols=100):
     # Creates a DataFrame from an RDD of tuple/list, list or pandas.DataFrame.
     # On scala backend, to transform RDD of Product to H2OFrame, we need to know Type Tag.
     # Since there is no alternative for Product class in Python, we first transform the rdd to dataframe
     # and then transform it to H2OFrame.
     df = h2oContext._spark_session.createDataFrame(dataframe)
     j_h2o_frame = h2oContext._jhc.asH2OFrame(df._jdf, frame_name)
     j_h2o_frame_key = j_h2o_frame.key()
     return H2OFrame.from_java_h2o_frame(j_h2o_frame,j_h2o_frame_key, full_cols)
コード例 #3
0
 def _as_h2o_frame_from_RDD_String(h2oContext,
                                   rdd,
                                   frame_name,
                                   full_cols=100):
     j_h2o_frame = h2oContext._jhc.asH2OFrameFromRDDString(
         rdd._to_java_object_rdd(), frame_name)
     j_h2o_frame_key = j_h2o_frame.key()
     return H2OFrame.from_java_h2o_frame(j_h2o_frame, j_h2o_frame_key,
                                         full_cols)
コード例 #4
0
 def _as_h2o_frame_from_complex_type(h2oContext,dataframe, framename):
     # Creates a DataFrame from an RDD of tuple/list, list or pandas.DataFrame.
     # On scala backend, to transform RDD of Product to H2OFrame, we need to know Type Tag.
     # Since there is no alternative for Product class in Python, we first transform the rdd to dataframe
     # and then transform it to H2OFrame.
     df = h2oContext._sqlContext.createDataFrame(dataframe)
     j_h2o_frame = h2oContext._jhc.asH2OFrame(df._jdf)
     j_h2o_frame_key = j_h2o_frame.key()
     return H2OFrame.from_java_h2o_frame(j_h2o_frame,j_h2o_frame_key)
コード例 #5
0
 def _as_h2o_frame_from_dataframe(h2oContext,
                                  dataframe,
                                  frame_name,
                                  full_cols=100):
     if dataframe.count() == 0:
         raise ValueError('Cannot transform empty H2OFrame')
     j_h2o_frame = h2oContext._jhc.asH2OFrame(dataframe._jdf, frame_name)
     j_h2o_frame_key = j_h2o_frame.key()
     return H2OFrame.from_java_h2o_frame(j_h2o_frame, j_h2o_frame_key,
                                         full_cols)
コード例 #6
0
ファイル: conversions.py プロジェクト: h2oai/sparkling-water
 def _as_h2o_frame_from_RDD_String(h2oContext, rdd, frame_name, full_cols=100):
     j_h2o_frame = h2oContext._jhc.asH2OFrameFromRDDString(rdd._to_java_object_rdd(), frame_name)
     j_h2o_frame_key = j_h2o_frame.key()
     return H2OFrame.from_java_h2o_frame(j_h2o_frame,j_h2o_frame_key, full_cols)
コード例 #7
0
ファイル: conversions.py プロジェクト: h2oai/sparkling-water
 def _as_h2o_frame_from_dataframe(h2oContext, dataframe, frame_name, full_cols=100):
     j_h2o_frame = h2oContext._jhc.asH2OFrame(dataframe._jdf, frame_name)
     j_h2o_frame_key = j_h2o_frame.key()
     return H2OFrame.from_java_h2o_frame(j_h2o_frame,j_h2o_frame_key, full_cols)
コード例 #8
0
ファイル: utils.py プロジェクト: Atry/sparkling-water
 def _as_h2o_frame_from_dataframe(h2oContext, dataframe, framename):
     if dataframe.count() == 0:
         raise ValueError('Cannot transform empty H2OFrame')
     j_h2o_frame = h2oContext._jhc.asH2OFrame(dataframe._jdf, framename)
     j_h2o_frame_key = j_h2o_frame.key()
     return H2OFrame.from_java_h2o_frame(j_h2o_frame,j_h2o_frame_key)
コード例 #9
0
 def _as_h2o_frame_from_RDD_Long(h2oContext, rdd, framename):
     j_h2o_frame = h2oContext._jhc.asH2OFrameFromRDDLong(rdd._to_java_object_rdd(), framename)
     j_h2o_frame_key = j_h2o_frame.key()
     return H2OFrame.from_java_h2o_frame(j_h2o_frame,j_h2o_frame_key)
コード例 #10
0
 def _as_h2o_frame_from_RDD_Double(h2oContext, rdd, frame_name):
     j_h2o_frame = h2oContext._jhc.asH2OFrameFromPythonRDDDouble(rdd._to_java_object_rdd(), frame_name)
     j_h2o_frame_key = j_h2o_frame.key()
     return H2OFrame.from_java_h2o_frame(j_h2o_frame,j_h2o_frame_key)
コード例 #11
0
 def _as_h2o_frame_from_RDD_Double(h2oContext, rdd, frame_name):
     j_h2o_frame = h2oContext._jhc.asH2OFrameFromPythonRDDDouble(
         rdd._to_java_object_rdd(), frame_name)
     j_h2o_frame_key = j_h2o_frame.key()
     return H2OFrame.from_java_h2o_frame(j_h2o_frame, j_h2o_frame_key)