Ejemplo n.º 1
0
    def get_frame(self):
        """
        Return the resulting H2OFrame containing the result(s) of aggregation(s) of the group by.

        The number of rows denote the number of groups generated by the group by operation.

        The number of columns depend on the number of aggregations performed, the number of columns specified in
        the col parameter.  Generally, expect the number of columns to be

        (len(col) of aggregation 0 + len(col) of aggregation 1 +...+ len(col) of aggregation n) x (number of groups of the GroupBy object)
        +1 (for group-by group names).

        Note:
            - the count aggregation only generates one column;
            - if col is a str or int, len(col) = 1.
        """
        if self._res is None:
            aggs = []
            for k in self._aggs:
                aggs += (self._aggs[k])
            self._res = h2o.H2OFrame._expr(
                expr=ExprNode("GB", self._fr, self._by, *aggs))
        return self._res
Ejemplo n.º 2
0
 def list_timezones(self):
     """Return the list of all known timezones."""
     from h2o.expr import ExprNode
     return h2o.H2OFrame._expr(expr=ExprNode("listTimeZones"))._frame()
Ejemplo n.º 3
0
 def result(self):
     """
     Get result frame that contains information about the model building process like for maxrglm and anovaglm.
     :return: the H2OFrame that contains information about the model building process like for maxrglm and anovaglm.
     """
     return H2OFrame._expr(expr=ExprNode("result", ASTId(self.key)))._frame(fill_cache=True)
Ejemplo n.º 4
0
def pubdev_5180():

    frame = h2o.create_frame(binary_fraction=1, binary_ones_fraction=0.5, missing_fraction=0, rows=1, cols=1)
    exp_str = ExprNode("assign", 123456789123456789123456789, frame)._get_ast_str(False)
    assert exp_str.find('123456789123456789L') == -1
Ejemplo n.º 5
0
def pav(y, X, w):
    # make H2O Frame (y, X, w)
    frame = H2OFrame(np.column_stack((y, X, w)))
    return H2OFrame._expr(expr=ExprNode("isotonic.pav", frame))[["C1", "C2"]]