partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
test | H2OFrame.substring | For each string, return a new string that is a substring of the original string.
If end_index is not specified, then the substring extends to the end of the original string. If the start_index
is longer than the length of the string, or is greater than or equal to the end_index, an empty string is
... | h2o-py/h2o/frame.py | def substring(self, start_index, end_index=None):
"""
For each string, return a new string that is a substring of the original string.
If end_index is not specified, then the substring extends to the end of the original string. If the start_index
is longer than the length of the string,... | def substring(self, start_index, end_index=None):
"""
For each string, return a new string that is a substring of the original string.
If end_index is not specified, then the substring extends to the end of the original string. If the start_index
is longer than the length of the string,... | [
"For",
"each",
"string",
"return",
"a",
"new",
"string",
"that",
"is",
"a",
"substring",
"of",
"the",
"original",
"string",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2391-L2406 | [
"def",
"substring",
"(",
"self",
",",
"start_index",
",",
"end_index",
"=",
"None",
")",
":",
"fr",
"=",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"substring\"",
",",
"self",
",",
"start_index",
",",
"end_index",
")",
")",
"fr",
".... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.lstrip | Return a copy of the column with leading characters removed.
The set argument is a string specifying the set of characters to be removed.
If omitted, the set argument defaults to removing whitespace.
:param character set: The set of characters to lstrip from strings in column.
:returns... | h2o-py/h2o/frame.py | def lstrip(self, set=" "):
"""
Return a copy of the column with leading characters removed.
The set argument is a string specifying the set of characters to be removed.
If omitted, the set argument defaults to removing whitespace.
:param character set: The set of characters to ... | def lstrip(self, set=" "):
"""
Return a copy of the column with leading characters removed.
The set argument is a string specifying the set of characters to be removed.
If omitted, the set argument defaults to removing whitespace.
:param character set: The set of characters to ... | [
"Return",
"a",
"copy",
"of",
"the",
"column",
"with",
"leading",
"characters",
"removed",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2409-L2426 | [
"def",
"lstrip",
"(",
"self",
",",
"set",
"=",
"\" \"",
")",
":",
"# work w/ None; parity with python lstrip",
"if",
"set",
"is",
"None",
":",
"set",
"=",
"\" \"",
"fr",
"=",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"lstrip\"",
",",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.entropy | For each string compute its Shannon entropy, if the string is empty the entropy is 0.
:returns: an H2OFrame of Shannon entropies. | h2o-py/h2o/frame.py | def entropy(self):
"""
For each string compute its Shannon entropy, if the string is empty the entropy is 0.
:returns: an H2OFrame of Shannon entropies.
"""
fr = H2OFrame._expr(expr=ExprNode("entropy", self))
fr._ex._cache.nrows = self.nrow
fr._ex._cache.ncol = s... | def entropy(self):
"""
For each string compute its Shannon entropy, if the string is empty the entropy is 0.
:returns: an H2OFrame of Shannon entropies.
"""
fr = H2OFrame._expr(expr=ExprNode("entropy", self))
fr._ex._cache.nrows = self.nrow
fr._ex._cache.ncol = s... | [
"For",
"each",
"string",
"compute",
"its",
"Shannon",
"entropy",
"if",
"the",
"string",
"is",
"empty",
"the",
"entropy",
"is",
"0",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2449-L2458 | [
"def",
"entropy",
"(",
"self",
")",
":",
"fr",
"=",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"entropy\"",
",",
"self",
")",
")",
"fr",
".",
"_ex",
".",
"_cache",
".",
"nrows",
"=",
"self",
".",
"nrow",
"fr",
".",
"_ex",
".",... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.num_valid_substrings | For each string, find the count of all possible substrings with 2 characters or more that are contained in
the line-separated text file whose path is given.
:param str path_to_words: Path to file that contains a line-separated list of strings considered valid.
:returns: An H2OFrame with the num... | h2o-py/h2o/frame.py | def num_valid_substrings(self, path_to_words):
"""
For each string, find the count of all possible substrings with 2 characters or more that are contained in
the line-separated text file whose path is given.
:param str path_to_words: Path to file that contains a line-separated list of s... | def num_valid_substrings(self, path_to_words):
"""
For each string, find the count of all possible substrings with 2 characters or more that are contained in
the line-separated text file whose path is given.
:param str path_to_words: Path to file that contains a line-separated list of s... | [
"For",
"each",
"string",
"find",
"the",
"count",
"of",
"all",
"possible",
"substrings",
"with",
"2",
"characters",
"or",
"more",
"that",
"are",
"contained",
"in",
"the",
"line",
"-",
"separated",
"text",
"file",
"whose",
"path",
"is",
"given",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2461-L2473 | [
"def",
"num_valid_substrings",
"(",
"self",
",",
"path_to_words",
")",
":",
"assert_is_type",
"(",
"path_to_words",
",",
"str",
")",
"fr",
"=",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"num_valid_substrings\"",
",",
"self",
",",
"path_to_... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.table | Compute the counts of values appearing in a column, or co-occurence counts between two columns.
:param H2OFrame data2: An optional single column to aggregate counts by.
:param bool dense: If True (default) then use dense representation, which lists only non-zero counts,
1 combination per ro... | h2o-py/h2o/frame.py | def table(self, data2=None, dense=True):
"""
Compute the counts of values appearing in a column, or co-occurence counts between two columns.
:param H2OFrame data2: An optional single column to aggregate counts by.
:param bool dense: If True (default) then use dense representation, which... | def table(self, data2=None, dense=True):
"""
Compute the counts of values appearing in a column, or co-occurence counts between two columns.
:param H2OFrame data2: An optional single column to aggregate counts by.
:param bool dense: If True (default) then use dense representation, which... | [
"Compute",
"the",
"counts",
"of",
"values",
"appearing",
"in",
"a",
"column",
"or",
"co",
"-",
"occurence",
"counts",
"between",
"two",
"columns",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2485-L2496 | [
"def",
"table",
"(",
"self",
",",
"data2",
"=",
"None",
",",
"dense",
"=",
"True",
")",
":",
"return",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"table\"",
",",
"self",
",",
"data2",
",",
"dense",
")",
")",
"if",
"data2",
"is",... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.hist | Compute a histogram over a numeric column.
:param breaks: Can be one of ``"sturges"``, ``"rice"``, ``"sqrt"``, ``"doane"``, ``"fd"``, ``"scott"``;
or a single number for the number of breaks; or a list containing the split points, e.g:
``[-50, 213.2123, 9324834]``. If breaks is "fd", th... | h2o-py/h2o/frame.py | def hist(self, breaks="sturges", plot=True, **kwargs):
"""
Compute a histogram over a numeric column.
:param breaks: Can be one of ``"sturges"``, ``"rice"``, ``"sqrt"``, ``"doane"``, ``"fd"``, ``"scott"``;
or a single number for the number of breaks; or a list containing the split p... | def hist(self, breaks="sturges", plot=True, **kwargs):
"""
Compute a histogram over a numeric column.
:param breaks: Can be one of ``"sturges"``, ``"rice"``, ``"sqrt"``, ``"doane"``, ``"fd"``, ``"scott"``;
or a single number for the number of breaks; or a list containing the split p... | [
"Compute",
"a",
"histogram",
"over",
"a",
"numeric",
"column",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2499-L2544 | [
"def",
"hist",
"(",
"self",
",",
"breaks",
"=",
"\"sturges\"",
",",
"plot",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"server",
"=",
"kwargs",
".",
"pop",
"(",
"\"server\"",
")",
"if",
"\"server\"",
"in",
"kwargs",
"else",
"False",
"assert_is_typ... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.isax | Compute the iSAX index for DataFrame which is assumed to be numeric time series data.
References:
- http://www.cs.ucr.edu/~eamonn/SAX.pdf
- http://www.cs.ucr.edu/~eamonn/iSAX_2.0.pdf
:param int num_words: Number of iSAX words for the timeseries, i.e. granularity along the time... | h2o-py/h2o/frame.py | def isax(self, num_words, max_cardinality, optimize_card=False, **kwargs):
"""
Compute the iSAX index for DataFrame which is assumed to be numeric time series data.
References:
- http://www.cs.ucr.edu/~eamonn/SAX.pdf
- http://www.cs.ucr.edu/~eamonn/iSAX_2.0.pdf
... | def isax(self, num_words, max_cardinality, optimize_card=False, **kwargs):
"""
Compute the iSAX index for DataFrame which is assumed to be numeric time series data.
References:
- http://www.cs.ucr.edu/~eamonn/SAX.pdf
- http://www.cs.ucr.edu/~eamonn/iSAX_2.0.pdf
... | [
"Compute",
"the",
"iSAX",
"index",
"for",
"DataFrame",
"which",
"is",
"assumed",
"to",
"be",
"numeric",
"time",
"series",
"data",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2547-L2566 | [
"def",
"isax",
"(",
"self",
",",
"num_words",
",",
"max_cardinality",
",",
"optimize_card",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"num_words",
"<=",
"0",
":",
"raise",
"H2OValueError",
"(",
"\"num_words must be greater than 0\"",
")",
"if",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.convert_H2OFrame_2_DMatrix | This method requires that you import the following toolboxes: xgboost, pandas, numpy and scipy.sparse.
This method will convert an H2OFrame to a DMatrix that can be used by native XGBoost. The H2OFrame contains
numerical and enum columns alone. Note that H2O one-hot-encoding introduces a missing(NA)
... | h2o-py/h2o/frame.py | def convert_H2OFrame_2_DMatrix(self, predictors, yresp, h2oXGBoostModel):
'''
This method requires that you import the following toolboxes: xgboost, pandas, numpy and scipy.sparse.
This method will convert an H2OFrame to a DMatrix that can be used by native XGBoost. The H2OFrame contains
... | def convert_H2OFrame_2_DMatrix(self, predictors, yresp, h2oXGBoostModel):
'''
This method requires that you import the following toolboxes: xgboost, pandas, numpy and scipy.sparse.
This method will convert an H2OFrame to a DMatrix that can be used by native XGBoost. The H2OFrame contains
... | [
"This",
"method",
"requires",
"that",
"you",
"import",
"the",
"following",
"toolboxes",
":",
"xgboost",
"pandas",
"numpy",
"and",
"scipy",
".",
"sparse",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2568-L2673 | [
"def",
"convert_H2OFrame_2_DMatrix",
"(",
"self",
",",
"predictors",
",",
"yresp",
",",
"h2oXGBoostModel",
")",
":",
"import",
"xgboost",
"as",
"xgb",
"import",
"pandas",
"as",
"pd",
"import",
"numpy",
"as",
"np",
"from",
"scipy",
".",
"sparse",
"import",
"c... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.pivot | Pivot the frame designated by the three columns: index, column, and value. Index and column should be
of type enum, int, or time.
For cases of multiple indexes for a column label, the aggregation method is to pick the first occurrence in the data frame
:param index: Index is a column that will ... | h2o-py/h2o/frame.py | def pivot(self, index, column, value):
"""
Pivot the frame designated by the three columns: index, column, and value. Index and column should be
of type enum, int, or time.
For cases of multiple indexes for a column label, the aggregation method is to pick the first occurrence in the dat... | def pivot(self, index, column, value):
"""
Pivot the frame designated by the three columns: index, column, and value. Index and column should be
of type enum, int, or time.
For cases of multiple indexes for a column label, the aggregation method is to pick the first occurrence in the dat... | [
"Pivot",
"the",
"frame",
"designated",
"by",
"the",
"three",
"columns",
":",
"index",
"column",
"and",
"value",
".",
"Index",
"and",
"column",
"should",
"be",
"of",
"type",
"enum",
"int",
"or",
"time",
".",
"For",
"cases",
"of",
"multiple",
"indexes",
"f... | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2675-L2700 | [
"def",
"pivot",
"(",
"self",
",",
"index",
",",
"column",
",",
"value",
")",
":",
"assert_is_type",
"(",
"index",
",",
"str",
")",
"assert_is_type",
"(",
"column",
",",
"str",
")",
"assert_is_type",
"(",
"value",
",",
"str",
")",
"col_names",
"=",
"sel... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.rank_within_group_by | This function will add a new column rank where the ranking is produced as follows:
1. sorts the H2OFrame by columns sorted in by columns specified in group_by_cols and sort_cols in the directions
specified by the ascending for the sort_cols. The sort directions for the group_by_cols are ascending o... | h2o-py/h2o/frame.py | def rank_within_group_by(self, group_by_cols, sort_cols, ascending=[], new_col_name="New_Rank_column", sort_cols_sorted=False):
"""
This function will add a new column rank where the ranking is produced as follows:
1. sorts the H2OFrame by columns sorted in by columns specified in group_by_cols... | def rank_within_group_by(self, group_by_cols, sort_cols, ascending=[], new_col_name="New_Rank_column", sort_cols_sorted=False):
"""
This function will add a new column rank where the ranking is produced as follows:
1. sorts the H2OFrame by columns sorted in by columns specified in group_by_cols... | [
"This",
"function",
"will",
"add",
"a",
"new",
"column",
"rank",
"where",
"the",
"ranking",
"is",
"produced",
"as",
"follows",
":",
"1",
".",
"sorts",
"the",
"H2OFrame",
"by",
"columns",
"sorted",
"in",
"by",
"columns",
"specified",
"in",
"group_by_cols",
... | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2702-L2822 | [
"def",
"rank_within_group_by",
"(",
"self",
",",
"group_by_cols",
",",
"sort_cols",
",",
"ascending",
"=",
"[",
"]",
",",
"new_col_name",
"=",
"\"New_Rank_column\"",
",",
"sort_cols_sorted",
"=",
"False",
")",
":",
"assert_is_type",
"(",
"group_by_cols",
",",
"s... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.topNBottomN | Given a column name or one column index, a percent N, this function will return the top or bottom N% of the
values of the column of a frame. The column must be a numerical column.
:param column: a string for column name or an integer index
:param nPercent: a top or bottom percentage of th... | h2o-py/h2o/frame.py | def topNBottomN(self, column=0, nPercent=10, grabTopN=-1):
"""
Given a column name or one column index, a percent N, this function will return the top or bottom N% of the
values of the column of a frame. The column must be a numerical column.
:param column: a string for column nam... | def topNBottomN(self, column=0, nPercent=10, grabTopN=-1):
"""
Given a column name or one column index, a percent N, this function will return the top or bottom N% of the
values of the column of a frame. The column must be a numerical column.
:param column: a string for column nam... | [
"Given",
"a",
"column",
"name",
"or",
"one",
"column",
"index",
"a",
"percent",
"N",
"this",
"function",
"will",
"return",
"the",
"top",
"or",
"bottom",
"N%",
"of",
"the",
"values",
"of",
"the",
"column",
"of",
"a",
"frame",
".",
"The",
"column",
"must... | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2824-L2853 | [
"def",
"topNBottomN",
"(",
"self",
",",
"column",
"=",
"0",
",",
"nPercent",
"=",
"10",
",",
"grabTopN",
"=",
"-",
"1",
")",
":",
"assert",
"(",
"nPercent",
">=",
"0",
")",
"and",
"(",
"nPercent",
"<=",
"100.0",
")",
",",
"\"nPercent must be between 0.... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.sub | Substitute the first occurrence of pattern in a string with replacement.
:param str pattern: A regular expression.
:param str replacement: A replacement string.
:param bool ignore_case: If True then pattern will match case-insensitively.
:returns: an H2OFrame with all values matching ``... | h2o-py/h2o/frame.py | def sub(self, pattern, replacement, ignore_case=False):
"""
Substitute the first occurrence of pattern in a string with replacement.
:param str pattern: A regular expression.
:param str replacement: A replacement string.
:param bool ignore_case: If True then pattern will match c... | def sub(self, pattern, replacement, ignore_case=False):
"""
Substitute the first occurrence of pattern in a string with replacement.
:param str pattern: A regular expression.
:param str replacement: A replacement string.
:param bool ignore_case: If True then pattern will match c... | [
"Substitute",
"the",
"first",
"occurrence",
"of",
"pattern",
"in",
"a",
"string",
"with",
"replacement",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2879-L2888 | [
"def",
"sub",
"(",
"self",
",",
"pattern",
",",
"replacement",
",",
"ignore_case",
"=",
"False",
")",
":",
"return",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"replacefirst\"",
",",
"self",
",",
"pattern",
",",
"replacement",
",",
"i... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.interaction | Categorical Interaction Feature Creation in H2O.
Creates a frame in H2O with n-th order interaction features between categorical columns, as specified by
the user.
:param factors: list of factor columns (either indices or column names).
:param bool pairwise: Whether to create pairwise ... | h2o-py/h2o/frame.py | def interaction(self, factors, pairwise, max_factors, min_occurrence, destination_frame=None):
"""
Categorical Interaction Feature Creation in H2O.
Creates a frame in H2O with n-th order interaction features between categorical columns, as specified by
the user.
:param factors:... | def interaction(self, factors, pairwise, max_factors, min_occurrence, destination_frame=None):
"""
Categorical Interaction Feature Creation in H2O.
Creates a frame in H2O with n-th order interaction features between categorical columns, as specified by
the user.
:param factors:... | [
"Categorical",
"Interaction",
"Feature",
"Creation",
"in",
"H2O",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2903-L2921 | [
"def",
"interaction",
"(",
"self",
",",
"factors",
",",
"pairwise",
",",
"max_factors",
",",
"min_occurrence",
",",
"destination_frame",
"=",
"None",
")",
":",
"return",
"h2o",
".",
"interaction",
"(",
"data",
"=",
"self",
",",
"factors",
"=",
"factors",
"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.toupper | Translate characters from lower to upper case for a particular column.
:returns: new H2OFrame with all strings in the current frame converted to the uppercase. | h2o-py/h2o/frame.py | def toupper(self):
"""
Translate characters from lower to upper case for a particular column.
:returns: new H2OFrame with all strings in the current frame converted to the uppercase.
"""
return H2OFrame._expr(expr=ExprNode("toupper", self), cache=self._ex._cache) | def toupper(self):
"""
Translate characters from lower to upper case for a particular column.
:returns: new H2OFrame with all strings in the current frame converted to the uppercase.
"""
return H2OFrame._expr(expr=ExprNode("toupper", self), cache=self._ex._cache) | [
"Translate",
"characters",
"from",
"lower",
"to",
"upper",
"case",
"for",
"a",
"particular",
"column",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2924-L2930 | [
"def",
"toupper",
"(",
"self",
")",
":",
"return",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"toupper\"",
",",
"self",
")",
",",
"cache",
"=",
"self",
".",
"_ex",
".",
"_cache",
")"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.grep | Searches for matches to argument `pattern` within each element
of a string column.
Default behavior is to return indices of the elements matching the pattern. Parameter
`output_logical` can be used to return a logical vector indicating if the element matches
the pattern (1) or not (0).
... | h2o-py/h2o/frame.py | def grep(self,pattern, ignore_case = False, invert = False, output_logical = False):
"""
Searches for matches to argument `pattern` within each element
of a string column.
Default behavior is to return indices of the elements matching the pattern. Parameter
`output_logical` can ... | def grep(self,pattern, ignore_case = False, invert = False, output_logical = False):
"""
Searches for matches to argument `pattern` within each element
of a string column.
Default behavior is to return indices of the elements matching the pattern. Parameter
`output_logical` can ... | [
"Searches",
"for",
"matches",
"to",
"argument",
"pattern",
"within",
"each",
"element",
"of",
"a",
"string",
"column",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2932-L2947 | [
"def",
"grep",
"(",
"self",
",",
"pattern",
",",
"ignore_case",
"=",
"False",
",",
"invert",
"=",
"False",
",",
"output_logical",
"=",
"False",
")",
":",
"return",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"grep\"",
",",
"self",
",... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.scale | Center and/or scale the columns of the current frame.
:param center: If True, then demean the data. If False, no shifting is done. If ``center`` is a list of
numbers then shift each column by the corresponding amount.
:param scale: If True, then scale the data by each column's standard devi... | h2o-py/h2o/frame.py | def scale(self, center=True, scale=True):
"""
Center and/or scale the columns of the current frame.
:param center: If True, then demean the data. If False, no shifting is done. If ``center`` is a list of
numbers then shift each column by the corresponding amount.
:param scal... | def scale(self, center=True, scale=True):
"""
Center and/or scale the columns of the current frame.
:param center: If True, then demean the data. If False, no shifting is done. If ``center`` is a list of
numbers then shift each column by the corresponding amount.
:param scal... | [
"Center",
"and",
"/",
"or",
"scale",
"the",
"columns",
"of",
"the",
"current",
"frame",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2975-L2985 | [
"def",
"scale",
"(",
"self",
",",
"center",
"=",
"True",
",",
"scale",
"=",
"True",
")",
":",
"return",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"scale\"",
",",
"self",
",",
"center",
",",
"scale",
")",
",",
"cache",
"=",
"sel... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.signif | Round doubles/floats to the given number of significant digits.
:param int digits: Number of significant digits to retain.
:returns: new H2OFrame with rounded values from the original frame. | h2o-py/h2o/frame.py | def signif(self, digits=6):
"""
Round doubles/floats to the given number of significant digits.
:param int digits: Number of significant digits to retain.
:returns: new H2OFrame with rounded values from the original frame.
"""
return H2OFrame._expr(expr=ExprNode("signif"... | def signif(self, digits=6):
"""
Round doubles/floats to the given number of significant digits.
:param int digits: Number of significant digits to retain.
:returns: new H2OFrame with rounded values from the original frame.
"""
return H2OFrame._expr(expr=ExprNode("signif"... | [
"Round",
"doubles",
"/",
"floats",
"to",
"the",
"given",
"number",
"of",
"significant",
"digits",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2988-L2995 | [
"def",
"signif",
"(",
"self",
",",
"digits",
"=",
"6",
")",
":",
"return",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"signif\"",
",",
"self",
",",
"digits",
")",
",",
"cache",
"=",
"self",
".",
"_ex",
".",
"_cache",
")"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.na_omit | Remove rows with NAs from the H2OFrame.
:returns: new H2OFrame with all rows from the original frame containing any NAs removed. | h2o-py/h2o/frame.py | def na_omit(self):
"""
Remove rows with NAs from the H2OFrame.
:returns: new H2OFrame with all rows from the original frame containing any NAs removed.
"""
fr = H2OFrame._expr(expr=ExprNode("na.omit", self), cache=self._ex._cache)
fr._ex._cache.nrows = -1
return ... | def na_omit(self):
"""
Remove rows with NAs from the H2OFrame.
:returns: new H2OFrame with all rows from the original frame containing any NAs removed.
"""
fr = H2OFrame._expr(expr=ExprNode("na.omit", self), cache=self._ex._cache)
fr._ex._cache.nrows = -1
return ... | [
"Remove",
"rows",
"with",
"NAs",
"from",
"the",
"H2OFrame",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L3030-L3038 | [
"def",
"na_omit",
"(",
"self",
")",
":",
"fr",
"=",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"na.omit\"",
",",
"self",
")",
",",
"cache",
"=",
"self",
".",
"_ex",
".",
"_cache",
")",
"fr",
".",
"_ex",
".",
"_cache",
".",
"nr... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.difflag1 | Conduct a diff-1 transform on a numeric frame column.
:returns: an H2OFrame where each element is equal to the corresponding element in the source
frame minus the previous-row element in the same frame. | h2o-py/h2o/frame.py | def difflag1(self):
"""
Conduct a diff-1 transform on a numeric frame column.
:returns: an H2OFrame where each element is equal to the corresponding element in the source
frame minus the previous-row element in the same frame.
"""
if self.ncols > 1:
raise... | def difflag1(self):
"""
Conduct a diff-1 transform on a numeric frame column.
:returns: an H2OFrame where each element is equal to the corresponding element in the source
frame minus the previous-row element in the same frame.
"""
if self.ncols > 1:
raise... | [
"Conduct",
"a",
"diff",
"-",
"1",
"transform",
"on",
"a",
"numeric",
"frame",
"column",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L3041-L3053 | [
"def",
"difflag1",
"(",
"self",
")",
":",
"if",
"self",
".",
"ncols",
">",
"1",
":",
"raise",
"H2OValueError",
"(",
"\"Only single-column frames supported\"",
")",
"if",
"self",
".",
"types",
"[",
"self",
".",
"columns",
"[",
"0",
"]",
"]",
"not",
"in",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.isna | For each element in an H2OFrame, determine if it is NA or not.
:returns: an H2OFrame of 1s and 0s, where 1s mean the values were NAs. | h2o-py/h2o/frame.py | def isna(self):
"""
For each element in an H2OFrame, determine if it is NA or not.
:returns: an H2OFrame of 1s and 0s, where 1s mean the values were NAs.
"""
fr = H2OFrame._expr(expr=ExprNode("is.na", self))
fr._ex._cache.nrows = self._ex._cache.nrows
fr._ex._cac... | def isna(self):
"""
For each element in an H2OFrame, determine if it is NA or not.
:returns: an H2OFrame of 1s and 0s, where 1s mean the values were NAs.
"""
fr = H2OFrame._expr(expr=ExprNode("is.na", self))
fr._ex._cache.nrows = self._ex._cache.nrows
fr._ex._cac... | [
"For",
"each",
"element",
"in",
"an",
"H2OFrame",
"determine",
"if",
"it",
"is",
"NA",
"or",
"not",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L3056-L3068 | [
"def",
"isna",
"(",
"self",
")",
":",
"fr",
"=",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"is.na\"",
",",
"self",
")",
")",
"fr",
".",
"_ex",
".",
"_cache",
".",
"nrows",
"=",
"self",
".",
"_ex",
".",
"_cache",
".",
"nrows",... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.minute | Extract the "minute" part from a date column.
:returns: a single-column H2OFrame containing the "minute" part from the source frame. | h2o-py/h2o/frame.py | def minute(self):
"""
Extract the "minute" part from a date column.
:returns: a single-column H2OFrame containing the "minute" part from the source frame.
"""
fr = H2OFrame._expr(expr=ExprNode("minute", self), cache=self._ex._cache)
if fr._ex._cache.types_valid():
... | def minute(self):
"""
Extract the "minute" part from a date column.
:returns: a single-column H2OFrame containing the "minute" part from the source frame.
"""
fr = H2OFrame._expr(expr=ExprNode("minute", self), cache=self._ex._cache)
if fr._ex._cache.types_valid():
... | [
"Extract",
"the",
"minute",
"part",
"from",
"a",
"date",
"column",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L3143-L3152 | [
"def",
"minute",
"(",
"self",
")",
":",
"fr",
"=",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"minute\"",
",",
"self",
")",
",",
"cache",
"=",
"self",
".",
"_ex",
".",
"_cache",
")",
"if",
"fr",
".",
"_ex",
".",
"_cache",
".",... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.runif | Generate a column of random numbers drawn from a uniform distribution [0,1) and
having the same data layout as the source frame.
:param int seed: seed for the random number generator.
:returns: Single-column H2OFrame filled with doubles sampled uniformly from [0,1). | h2o-py/h2o/frame.py | def runif(self, seed=None):
"""
Generate a column of random numbers drawn from a uniform distribution [0,1) and
having the same data layout as the source frame.
:param int seed: seed for the random number generator.
:returns: Single-column H2OFrame filled with doubles sampled u... | def runif(self, seed=None):
"""
Generate a column of random numbers drawn from a uniform distribution [0,1) and
having the same data layout as the source frame.
:param int seed: seed for the random number generator.
:returns: Single-column H2OFrame filled with doubles sampled u... | [
"Generate",
"a",
"column",
"of",
"random",
"numbers",
"drawn",
"from",
"a",
"uniform",
"distribution",
"[",
"0",
"1",
")",
"and",
"having",
"the",
"same",
"data",
"layout",
"as",
"the",
"source",
"frame",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L3167-L3179 | [
"def",
"runif",
"(",
"self",
",",
"seed",
"=",
"None",
")",
":",
"fr",
"=",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"h2o.runif\"",
",",
"self",
",",
"-",
"1",
"if",
"seed",
"is",
"None",
"else",
"seed",
")",
")",
"fr",
".",... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.stratified_split | Construct a column that can be used to perform a random stratified split.
:param float test_frac: The fraction of rows that will belong to the "test".
:param int seed: The seed for the random number generator.
:returns: an H2OFrame having single categorical column with two levels: ``"train"`` ... | h2o-py/h2o/frame.py | def stratified_split(self, test_frac=0.2, seed=-1):
"""
Construct a column that can be used to perform a random stratified split.
:param float test_frac: The fraction of rows that will belong to the "test".
:param int seed: The seed for the random number generator.
:returns: an... | def stratified_split(self, test_frac=0.2, seed=-1):
"""
Construct a column that can be used to perform a random stratified split.
:param float test_frac: The fraction of rows that will belong to the "test".
:param int seed: The seed for the random number generator.
:returns: an... | [
"Construct",
"a",
"column",
"that",
"can",
"be",
"used",
"to",
"perform",
"a",
"random",
"stratified",
"split",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L3182-L3202 | [
"def",
"stratified_split",
"(",
"self",
",",
"test_frac",
"=",
"0.2",
",",
"seed",
"=",
"-",
"1",
")",
":",
"return",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"'h2o.random_stratified_split'",
",",
"self",
",",
"test_frac",
",",
"seed",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.match | Make a vector of the positions of (first) matches of its first argument in its second.
Only applicable to single-column categorical/string frames.
:param List table: the list of items to match against
:param int nomatch: value that should be returned when there is no match.
:returns: a... | h2o-py/h2o/frame.py | def match(self, table, nomatch=0):
"""
Make a vector of the positions of (first) matches of its first argument in its second.
Only applicable to single-column categorical/string frames.
:param List table: the list of items to match against
:param int nomatch: value that should ... | def match(self, table, nomatch=0):
"""
Make a vector of the positions of (first) matches of its first argument in its second.
Only applicable to single-column categorical/string frames.
:param List table: the list of items to match against
:param int nomatch: value that should ... | [
"Make",
"a",
"vector",
"of",
"the",
"positions",
"of",
"(",
"first",
")",
"matches",
"of",
"its",
"first",
"argument",
"in",
"its",
"second",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L3205-L3216 | [
"def",
"match",
"(",
"self",
",",
"table",
",",
"nomatch",
"=",
"0",
")",
":",
"return",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"match\"",
",",
"self",
",",
"table",
",",
"nomatch",
",",
"None",
")",
")"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.cut | Cut a numeric vector into categorical "buckets".
This method is only applicable to a single-column numeric frame.
:param List[float] breaks: The cut points in the numeric vector.
:param List[str] labels: Labels for categorical levels produced. Defaults to set notation of
intervals ... | h2o-py/h2o/frame.py | def cut(self, breaks, labels=None, include_lowest=False, right=True, dig_lab=3):
"""
Cut a numeric vector into categorical "buckets".
This method is only applicable to a single-column numeric frame.
:param List[float] breaks: The cut points in the numeric vector.
:param List[st... | def cut(self, breaks, labels=None, include_lowest=False, right=True, dig_lab=3):
"""
Cut a numeric vector into categorical "buckets".
This method is only applicable to a single-column numeric frame.
:param List[float] breaks: The cut points in the numeric vector.
:param List[st... | [
"Cut",
"a",
"numeric",
"vector",
"into",
"categorical",
"buckets",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L3219-L3241 | [
"def",
"cut",
"(",
"self",
",",
"breaks",
",",
"labels",
"=",
"None",
",",
"include_lowest",
"=",
"False",
",",
"right",
"=",
"True",
",",
"dig_lab",
"=",
"3",
")",
":",
"assert_is_type",
"(",
"breaks",
",",
"[",
"numeric",
"]",
")",
"if",
"self",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.idxmax | Get the index of the max value in a column or row
:param bool skipna: If True (default), then NAs are ignored during the search. Otherwise presence
of NAs renders the entire result NA.
:param int axis: Direction of finding the max index. If 0 (default), then the max index is searched column... | h2o-py/h2o/frame.py | def idxmax(self,skipna=True, axis=0):
"""
Get the index of the max value in a column or row
:param bool skipna: If True (default), then NAs are ignored during the search. Otherwise presence
of NAs renders the entire result NA.
:param int axis: Direction of finding the max in... | def idxmax(self,skipna=True, axis=0):
"""
Get the index of the max value in a column or row
:param bool skipna: If True (default), then NAs are ignored during the search. Otherwise presence
of NAs renders the entire result NA.
:param int axis: Direction of finding the max in... | [
"Get",
"the",
"index",
"of",
"the",
"max",
"value",
"in",
"a",
"column",
"or",
"row"
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L3256-L3268 | [
"def",
"idxmax",
"(",
"self",
",",
"skipna",
"=",
"True",
",",
"axis",
"=",
"0",
")",
":",
"return",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"which.max\"",
",",
"self",
",",
"skipna",
",",
"axis",
")",
")"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.ifelse | Equivalent to ``[y if t else n for t,y,n in zip(self,yes,no)]``.
Based on the booleans in the test vector, the output has the values of the
yes and no vectors interleaved (or merged together). All Frames must have
the same row count. Single column frames are broadened to match wider
F... | h2o-py/h2o/frame.py | def ifelse(self, yes, no):
"""
Equivalent to ``[y if t else n for t,y,n in zip(self,yes,no)]``.
Based on the booleans in the test vector, the output has the values of the
yes and no vectors interleaved (or merged together). All Frames must have
the same row count. Single colum... | def ifelse(self, yes, no):
"""
Equivalent to ``[y if t else n for t,y,n in zip(self,yes,no)]``.
Based on the booleans in the test vector, the output has the values of the
yes and no vectors interleaved (or merged together). All Frames must have
the same row count. Single colum... | [
"Equivalent",
"to",
"[",
"y",
"if",
"t",
"else",
"n",
"for",
"t",
"y",
"n",
"in",
"zip",
"(",
"self",
"yes",
"no",
")",
"]",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L3285-L3299 | [
"def",
"ifelse",
"(",
"self",
",",
"yes",
",",
"no",
")",
":",
"return",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"ifelse\"",
",",
"self",
",",
"yes",
",",
"no",
")",
")"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.apply | Apply a lambda expression to an H2OFrame.
:param fun: a lambda expression to be applied per row or per column.
:param axis: 0 = apply to each column; 1 = apply to each row
:returns: a new H2OFrame with the results of applying ``fun`` to the current frame. | h2o-py/h2o/frame.py | def apply(self, fun=None, axis=0):
"""
Apply a lambda expression to an H2OFrame.
:param fun: a lambda expression to be applied per row or per column.
:param axis: 0 = apply to each column; 1 = apply to each row
:returns: a new H2OFrame with the results of applying ``fun`` to the... | def apply(self, fun=None, axis=0):
"""
Apply a lambda expression to an H2OFrame.
:param fun: a lambda expression to be applied per row or per column.
:param axis: 0 = apply to each column; 1 = apply to each row
:returns: a new H2OFrame with the results of applying ``fun`` to the... | [
"Apply",
"a",
"lambda",
"expression",
"to",
"an",
"H2OFrame",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L3302-L3315 | [
"def",
"apply",
"(",
"self",
",",
"fun",
"=",
"None",
",",
"axis",
"=",
"0",
")",
":",
"from",
".",
"astfun",
"import",
"lambda_to_expr",
"assert_is_type",
"(",
"axis",
",",
"0",
",",
"1",
")",
"assert_is_type",
"(",
"fun",
",",
"FunctionType",
")",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.mktime | Deprecated, use :func:`moment` instead.
This function was left for backward-compatibility purposes only. It is
not very stable, and counterintuitively uses 0-based months and days,
so "January 4th, 2001" should be entered as ``mktime(2001, 0, 3)``. | h2o-py/h2o/frame.py | def mktime(year=1970, month=0, day=0, hour=0, minute=0, second=0, msec=0):
"""
Deprecated, use :func:`moment` instead.
This function was left for backward-compatibility purposes only. It is
not very stable, and counterintuitively uses 0-based months and days,
so "January 4th, 20... | def mktime(year=1970, month=0, day=0, hour=0, minute=0, second=0, msec=0):
"""
Deprecated, use :func:`moment` instead.
This function was left for backward-compatibility purposes only. It is
not very stable, and counterintuitively uses 0-based months and days,
so "January 4th, 20... | [
"Deprecated",
"use",
":",
"func",
":",
"moment",
"instead",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L3326-L3334 | [
"def",
"mktime",
"(",
"year",
"=",
"1970",
",",
"month",
"=",
"0",
",",
"day",
"=",
"0",
",",
"hour",
"=",
"0",
",",
"minute",
"=",
"0",
",",
"second",
"=",
"0",
",",
"msec",
"=",
"0",
")",
":",
"return",
"H2OFrame",
".",
"_expr",
"(",
"ExprN... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.from_python | [DEPRECATED] Use constructor ``H2OFrame()`` instead. | h2o-py/h2o/frame.py | def from_python(python_obj, destination_frame=None, header=0, separator=",", column_names=None,
column_types=None, na_strings=None):
"""[DEPRECATED] Use constructor ``H2OFrame()`` instead."""
return H2OFrame(python_obj, destination_frame, header, separator, column_names, column_types... | def from_python(python_obj, destination_frame=None, header=0, separator=",", column_names=None,
column_types=None, na_strings=None):
"""[DEPRECATED] Use constructor ``H2OFrame()`` instead."""
return H2OFrame(python_obj, destination_frame, header, separator, column_names, column_types... | [
"[",
"DEPRECATED",
"]",
"Use",
"constructor",
"H2OFrame",
"()",
"instead",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L3383-L3387 | [
"def",
"from_python",
"(",
"python_obj",
",",
"destination_frame",
"=",
"None",
",",
"header",
"=",
"0",
",",
"separator",
"=",
"\",\"",
",",
"column_names",
"=",
"None",
",",
"column_types",
"=",
"None",
",",
"na_strings",
"=",
"None",
")",
":",
"return",... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | parse_text | Parse code from a string of text. | h2o-bindings/bin/pyparser.py | def parse_text(text):
"""Parse code from a string of text."""
assert isinstance(text, _str_type), "`text` parameter should be a string, got %r" % type(text)
gen = iter(text.splitlines(True)) # True = keep newlines
readline = gen.next if hasattr(gen, "next") else gen.__next__
return Code(_tokenize(r... | def parse_text(text):
"""Parse code from a string of text."""
assert isinstance(text, _str_type), "`text` parameter should be a string, got %r" % type(text)
gen = iter(text.splitlines(True)) # True = keep newlines
readline = gen.next if hasattr(gen, "next") else gen.__next__
return Code(_tokenize(r... | [
"Parse",
"code",
"from",
"a",
"string",
"of",
"text",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-bindings/bin/pyparser.py#L42-L47 | [
"def",
"parse_text",
"(",
"text",
")",
":",
"assert",
"isinstance",
"(",
"text",
",",
"_str_type",
")",
",",
"\"`text` parameter should be a string, got %r\"",
"%",
"type",
"(",
"text",
")",
"gen",
"=",
"iter",
"(",
"text",
".",
"splitlines",
"(",
"True",
")... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | parse_file | Parse the provided file, and return Code object. | h2o-bindings/bin/pyparser.py | def parse_file(filename):
"""Parse the provided file, and return Code object."""
assert isinstance(filename, _str_type), "`filename` parameter should be a string, got %r" % type(filename)
with open(filename, "rt", encoding="utf-8") as f:
return Code(_tokenize(f.readline)) | def parse_file(filename):
"""Parse the provided file, and return Code object."""
assert isinstance(filename, _str_type), "`filename` parameter should be a string, got %r" % type(filename)
with open(filename, "rt", encoding="utf-8") as f:
return Code(_tokenize(f.readline)) | [
"Parse",
"the",
"provided",
"file",
"and",
"return",
"Code",
"object",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-bindings/bin/pyparser.py#L50-L54 | [
"def",
"parse_file",
"(",
"filename",
")",
":",
"assert",
"isinstance",
"(",
"filename",
",",
"_str_type",
")",
",",
"\"`filename` parameter should be a string, got %r\"",
"%",
"type",
"(",
"filename",
")",
"with",
"open",
"(",
"filename",
",",
"\"rt\"",
",",
"e... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | _tokenize | Parse any object accessible through a readline interface into a list of :class:`Token`s.
This function is very similar to :func:`tokenize.generate_tokens`, with few differences. First, the returned list
is a list of :class:`Token` objects instead of 5-tuples. This may be slightly less efficient, but far more
... | h2o-bindings/bin/pyparser.py | def _tokenize(readline):
"""
Parse any object accessible through a readline interface into a list of :class:`Token`s.
This function is very similar to :func:`tokenize.generate_tokens`, with few differences. First, the returned list
is a list of :class:`Token` objects instead of 5-tuples. This may be sl... | def _tokenize(readline):
"""
Parse any object accessible through a readline interface into a list of :class:`Token`s.
This function is very similar to :func:`tokenize.generate_tokens`, with few differences. First, the returned list
is a list of :class:`Token` objects instead of 5-tuples. This may be sl... | [
"Parse",
"any",
"object",
"accessible",
"through",
"a",
"readline",
"interface",
"into",
"a",
"list",
"of",
":",
"class",
":",
"Token",
"s",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-bindings/bin/pyparser.py#L62-L169 | [
"def",
"_tokenize",
"(",
"readline",
")",
":",
"assert",
"callable",
"(",
"readline",
")",
",",
"\"`readline` should be a function\"",
"# Generate the initial list of tokens.",
"tokens",
"=",
"[",
"Token",
"(",
"tok",
")",
"for",
"tok",
"in",
"tokenize",
".",
"gen... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | Token.move | Move the token by `drow` rows and `dcol` columns. | h2o-bindings/bin/pyparser.py | def move(self, drow, dcol=0):
"""Move the token by `drow` rows and `dcol` columns."""
self._start_row += drow
self._start_col += dcol
self._end_row += drow
self._end_col += dcol | def move(self, drow, dcol=0):
"""Move the token by `drow` rows and `dcol` columns."""
self._start_row += drow
self._start_col += dcol
self._end_row += drow
self._end_col += dcol | [
"Move",
"the",
"token",
"by",
"drow",
"rows",
"and",
"dcol",
"columns",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-bindings/bin/pyparser.py#L246-L251 | [
"def",
"move",
"(",
"self",
",",
"drow",
",",
"dcol",
"=",
"0",
")",
":",
"self",
".",
"_start_row",
"+=",
"drow",
"self",
".",
"_start_col",
"+=",
"dcol",
"self",
".",
"_end_row",
"+=",
"drow",
"self",
".",
"_end_col",
"+=",
"dcol"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | ParsedBase.unparse | Convert the parsed representation back into the source code. | h2o-bindings/bin/pyparser.py | def unparse(self):
"""Convert the parsed representation back into the source code."""
ut = Untokenizer(start_row=self._tokens[0].start_row)
self._unparse(ut)
return ut.result() | def unparse(self):
"""Convert the parsed representation back into the source code."""
ut = Untokenizer(start_row=self._tokens[0].start_row)
self._unparse(ut)
return ut.result() | [
"Convert",
"the",
"parsed",
"representation",
"back",
"into",
"the",
"source",
"code",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-bindings/bin/pyparser.py#L365-L369 | [
"def",
"unparse",
"(",
"self",
")",
":",
"ut",
"=",
"Untokenizer",
"(",
"start_row",
"=",
"self",
".",
"_tokens",
"[",
"0",
"]",
".",
"start_row",
")",
"self",
".",
"_unparse",
"(",
"ut",
")",
"return",
"ut",
".",
"result",
"(",
")"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | Code._parse1 | First stage of parsing the code (stored as a raw stream of tokens).
This method will do the initial pass of the ``self._tokens`` list of tokens, and mark different section as
belonging to one of the categories: comment, whitespace, docstring, import, code, decorator, def, class, end.
These sect... | h2o-bindings/bin/pyparser.py | def _parse1(self):
"""
First stage of parsing the code (stored as a raw stream of tokens).
This method will do the initial pass of the ``self._tokens`` list of tokens, and mark different section as
belonging to one of the categories: comment, whitespace, docstring, import, code, decorat... | def _parse1(self):
"""
First stage of parsing the code (stored as a raw stream of tokens).
This method will do the initial pass of the ``self._tokens`` list of tokens, and mark different section as
belonging to one of the categories: comment, whitespace, docstring, import, code, decorat... | [
"First",
"stage",
"of",
"parsing",
"the",
"code",
"(",
"stored",
"as",
"a",
"raw",
"stream",
"of",
"tokens",
")",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-bindings/bin/pyparser.py#L436-L523 | [
"def",
"_parse1",
"(",
"self",
")",
":",
"fragments",
"=",
"[",
"]",
"tokens",
"=",
"self",
".",
"_tokens",
"def",
"advance_after_newline",
"(",
"i0",
")",
":",
"\"\"\"Return the index of the first token after the end of the current (logical) line.\"\"\"",
"for",
"i",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | Code._parse2 | Second stage of parsing: convert ``fragments`` into the list of code objects.
This method in fact does more than simple conversion of fragments into objects. It also attempts to group
certain fragments into one, if they in fact seem like a single piece. For example, decorators are grouped
toget... | h2o-bindings/bin/pyparser.py | def _parse2(self, fragments):
"""
Second stage of parsing: convert ``fragments`` into the list of code objects.
This method in fact does more than simple conversion of fragments into objects. It also attempts to group
certain fragments into one, if they in fact seem like a single piece.... | def _parse2(self, fragments):
"""
Second stage of parsing: convert ``fragments`` into the list of code objects.
This method in fact does more than simple conversion of fragments into objects. It also attempts to group
certain fragments into one, if they in fact seem like a single piece.... | [
"Second",
"stage",
"of",
"parsing",
":",
"convert",
"fragments",
"into",
"the",
"list",
"of",
"code",
"objects",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-bindings/bin/pyparser.py#L526-L592 | [
"def",
"_parse2",
"(",
"self",
",",
"fragments",
")",
":",
"out",
"=",
"[",
"]",
"tokens",
"=",
"self",
".",
"_tokens",
"i",
"=",
"0",
"saved_start",
"=",
"None",
"while",
"i",
"<",
"len",
"(",
"fragments",
")",
":",
"ftype",
",",
"start",
",",
"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OClusteringModel.size | Get the sizes of each cluster.
If all are False (default), then return the training metric value.
If more than one options is set to True, then return a dictionary of metrics where
the keys are "train", "valid", and "xval".
:param bool train: If True, return the cluster sizes for the t... | h2o-py/h2o/model/clustering.py | def size(self, train=False, valid=False, xval=False):
"""
Get the sizes of each cluster.
If all are False (default), then return the training metric value.
If more than one options is set to True, then return a dictionary of metrics where
the keys are "train", "valid", and "xval... | def size(self, train=False, valid=False, xval=False):
"""
Get the sizes of each cluster.
If all are False (default), then return the training metric value.
If more than one options is set to True, then return a dictionary of metrics where
the keys are "train", "valid", and "xval... | [
"Get",
"the",
"sizes",
"of",
"each",
"cluster",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/clustering.py#L9-L27 | [
"def",
"size",
"(",
"self",
",",
"train",
"=",
"False",
",",
"valid",
"=",
"False",
",",
"xval",
"=",
"False",
")",
":",
"tm",
"=",
"ModelBase",
".",
"_get_metrics",
"(",
"self",
",",
"train",
",",
"valid",
",",
"xval",
")",
"m",
"=",
"{",
"}",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OClusteringModel.centers | The centers for the KMeans model. | h2o-py/h2o/model/clustering.py | def centers(self):
"""The centers for the KMeans model."""
o = self._model_json["output"]
cvals = o["centers"].cell_values
centers = [list(cval[1:]) for cval in cvals]
return centers | def centers(self):
"""The centers for the KMeans model."""
o = self._model_json["output"]
cvals = o["centers"].cell_values
centers = [list(cval[1:]) for cval in cvals]
return centers | [
"The",
"centers",
"for",
"the",
"KMeans",
"model",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/clustering.py#L143-L148 | [
"def",
"centers",
"(",
"self",
")",
":",
"o",
"=",
"self",
".",
"_model_json",
"[",
"\"output\"",
"]",
"cvals",
"=",
"o",
"[",
"\"centers\"",
"]",
".",
"cell_values",
"centers",
"=",
"[",
"list",
"(",
"cval",
"[",
"1",
":",
"]",
")",
"for",
"cval",... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OClusteringModel.centers_std | The standardized centers for the kmeans model. | h2o-py/h2o/model/clustering.py | def centers_std(self):
"""The standardized centers for the kmeans model."""
o = self._model_json["output"]
cvals = o["centers_std"].cell_values
centers_std = [list(cval[1:]) for cval in cvals]
centers_std = [list(x) for x in zip(*centers_std)]
return centers_std | def centers_std(self):
"""The standardized centers for the kmeans model."""
o = self._model_json["output"]
cvals = o["centers_std"].cell_values
centers_std = [list(cval[1:]) for cval in cvals]
centers_std = [list(x) for x in zip(*centers_std)]
return centers_std | [
"The",
"standardized",
"centers",
"for",
"the",
"kmeans",
"model",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/clustering.py#L151-L157 | [
"def",
"centers_std",
"(",
"self",
")",
":",
"o",
"=",
"self",
".",
"_model_json",
"[",
"\"output\"",
"]",
"cvals",
"=",
"o",
"[",
"\"centers_std\"",
"]",
".",
"cell_values",
"centers_std",
"=",
"[",
"list",
"(",
"cval",
"[",
"1",
":",
"]",
")",
"for... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | connect | Connect to an existing H2O server, remote or local.
There are two ways to connect to a server: either pass a `server` parameter containing an instance of
an H2OLocalServer, or specify `ip` and `port` of the server that you want to connect to.
:param server: An H2OLocalServer instance to connect to (option... | h2o-py/h2o/h2o.py | def connect(server=None, url=None, ip=None, port=None, https=None, verify_ssl_certificates=None, auth=None,
proxy=None, cookies=None, verbose=True, config=None):
"""
Connect to an existing H2O server, remote or local.
There are two ways to connect to a server: either pass a `server` parameter c... | def connect(server=None, url=None, ip=None, port=None, https=None, verify_ssl_certificates=None, auth=None,
proxy=None, cookies=None, verbose=True, config=None):
"""
Connect to an existing H2O server, remote or local.
There are two ways to connect to a server: either pass a `server` parameter c... | [
"Connect",
"to",
"an",
"existing",
"H2O",
"server",
"remote",
"or",
"local",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L59-L94 | [
"def",
"connect",
"(",
"server",
"=",
"None",
",",
"url",
"=",
"None",
",",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
",",
"https",
"=",
"None",
",",
"verify_ssl_certificates",
"=",
"None",
",",
"auth",
"=",
"None",
",",
"proxy",
"=",
"None",
",... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | api | Perform a REST API request to a previously connected server.
This function is mostly for internal purposes, but may occasionally be useful for direct access to
the backend H2O server. It has same parameters as :meth:`H2OConnection.request <h2o.backend.H2OConnection.request>`. | h2o-py/h2o/h2o.py | def api(endpoint, data=None, json=None, filename=None, save_to=None):
"""
Perform a REST API request to a previously connected server.
This function is mostly for internal purposes, but may occasionally be useful for direct access to
the backend H2O server. It has same parameters as :meth:`H2OConnectio... | def api(endpoint, data=None, json=None, filename=None, save_to=None):
"""
Perform a REST API request to a previously connected server.
This function is mostly for internal purposes, but may occasionally be useful for direct access to
the backend H2O server. It has same parameters as :meth:`H2OConnectio... | [
"Perform",
"a",
"REST",
"API",
"request",
"to",
"a",
"previously",
"connected",
"server",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L97-L106 | [
"def",
"api",
"(",
"endpoint",
",",
"data",
"=",
"None",
",",
"json",
"=",
"None",
",",
"filename",
"=",
"None",
",",
"save_to",
"=",
"None",
")",
":",
"# type checks are performed in H2OConnection class",
"_check_connection",
"(",
")",
"return",
"h2oconn",
".... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | version_check | Used to verify that h2o-python module and the H2O server are compatible with each other. | h2o-py/h2o/h2o.py | def version_check():
"""Used to verify that h2o-python module and the H2O server are compatible with each other."""
from .__init__ import __version__ as ver_pkg
ci = h2oconn.cluster
if not ci:
raise H2OConnectionError("Connection not initialized. Did you run h2o.connect()?")
ver_h2o = ci.ver... | def version_check():
"""Used to verify that h2o-python module and the H2O server are compatible with each other."""
from .__init__ import __version__ as ver_pkg
ci = h2oconn.cluster
if not ci:
raise H2OConnectionError("Connection not initialized. Did you run h2o.connect()?")
ver_h2o = ci.ver... | [
"Used",
"to",
"verify",
"that",
"h2o",
"-",
"python",
"module",
"and",
"the",
"H2O",
"server",
"are",
"compatible",
"with",
"each",
"other",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L115-L146 | [
"def",
"version_check",
"(",
")",
":",
"from",
".",
"__init__",
"import",
"__version__",
"as",
"ver_pkg",
"ci",
"=",
"h2oconn",
".",
"cluster",
"if",
"not",
"ci",
":",
"raise",
"H2OConnectionError",
"(",
"\"Connection not initialized. Did you run h2o.connect()?\"",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | init | Attempt to connect to a local server, or if not successful start a new server and connect to it.
:param url: Full URL of the server to connect to (can be used instead of `ip` + `port` + `https`).
:param ip: The ip address (or host name) of the server where H2O is running.
:param port: Port number that H2O ... | h2o-py/h2o/h2o.py | def init(url=None, ip=None, port=None, name=None, https=None, insecure=None, username=None, password=None,
cookies=None, proxy=None, start_h2o=True, nthreads=-1, ice_root=None, log_dir=None, log_level=None,
enable_assertions=True, max_mem_size=None, min_mem_size=None, strict_version_check=None, ignore... | def init(url=None, ip=None, port=None, name=None, https=None, insecure=None, username=None, password=None,
cookies=None, proxy=None, start_h2o=True, nthreads=-1, ice_root=None, log_dir=None, log_level=None,
enable_assertions=True, max_mem_size=None, min_mem_size=None, strict_version_check=None, ignore... | [
"Attempt",
"to",
"connect",
"to",
"a",
"local",
"server",
"or",
"if",
"not",
"successful",
"start",
"a",
"new",
"server",
"and",
"connect",
"to",
"it",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L149-L285 | [
"def",
"init",
"(",
"url",
"=",
"None",
",",
"ip",
"=",
"None",
",",
"port",
"=",
"None",
",",
"name",
"=",
"None",
",",
"https",
"=",
"None",
",",
"insecure",
"=",
"None",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
",",
"cookies... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | lazy_import | Import a single file or collection of files.
:param path: A path to a data file (remote or local).
:param pattern: Character string containing a regular expression to match file(s) in the folder.
:returns: either a :class:`H2OFrame` with the content of the provided file, or a list of such frames if
... | h2o-py/h2o/h2o.py | def lazy_import(path, pattern=None):
"""
Import a single file or collection of files.
:param path: A path to a data file (remote or local).
:param pattern: Character string containing a regular expression to match file(s) in the folder.
:returns: either a :class:`H2OFrame` with the content of the p... | def lazy_import(path, pattern=None):
"""
Import a single file or collection of files.
:param path: A path to a data file (remote or local).
:param pattern: Character string containing a regular expression to match file(s) in the folder.
:returns: either a :class:`H2OFrame` with the content of the p... | [
"Import",
"a",
"single",
"file",
"or",
"collection",
"of",
"files",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L287-L299 | [
"def",
"lazy_import",
"(",
"path",
",",
"pattern",
"=",
"None",
")",
":",
"assert_is_type",
"(",
"path",
",",
"str",
",",
"[",
"str",
"]",
")",
"assert_is_type",
"(",
"pattern",
",",
"str",
",",
"None",
")",
"paths",
"=",
"[",
"path",
"]",
"if",
"i... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | upload_file | Upload a dataset from the provided local path to the H2O cluster.
Does a single-threaded push to H2O. Also see :meth:`import_file`.
:param path: A path specifying the location of the data to upload.
:param destination_frame: The unique hex key assigned to the imported file. If none is given, a key will
... | h2o-py/h2o/h2o.py | def upload_file(path, destination_frame=None, header=0, sep=None, col_names=None, col_types=None,
na_strings=None, skipped_columns=None):
"""
Upload a dataset from the provided local path to the H2O cluster.
Does a single-threaded push to H2O. Also see :meth:`import_file`.
:param path:... | def upload_file(path, destination_frame=None, header=0, sep=None, col_names=None, col_types=None,
na_strings=None, skipped_columns=None):
"""
Upload a dataset from the provided local path to the H2O cluster.
Does a single-threaded push to H2O. Also see :meth:`import_file`.
:param path:... | [
"Upload",
"a",
"dataset",
"from",
"the",
"provided",
"local",
"path",
"to",
"the",
"H2O",
"cluster",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L310-L363 | [
"def",
"upload_file",
"(",
"path",
",",
"destination_frame",
"=",
"None",
",",
"header",
"=",
"0",
",",
"sep",
"=",
"None",
",",
"col_names",
"=",
"None",
",",
"col_types",
"=",
"None",
",",
"na_strings",
"=",
"None",
",",
"skipped_columns",
"=",
"None",... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | import_file | Import a dataset that is already on the cluster.
The path to the data must be a valid path for each node in the H2O cluster. If some node in the H2O cluster
cannot see the file, then an exception will be thrown by the H2O cluster. Does a parallel/distributed
multi-threaded pull of the data. The main differ... | h2o-py/h2o/h2o.py | def import_file(path=None, destination_frame=None, parse=True, header=0, sep=None, col_names=None, col_types=None,
na_strings=None, pattern=None, skipped_columns=None, custom_non_data_line_markers = None):
"""
Import a dataset that is already on the cluster.
The path to the data must be a v... | def import_file(path=None, destination_frame=None, parse=True, header=0, sep=None, col_names=None, col_types=None,
na_strings=None, pattern=None, skipped_columns=None, custom_non_data_line_markers = None):
"""
Import a dataset that is already on the cluster.
The path to the data must be a v... | [
"Import",
"a",
"dataset",
"that",
"is",
"already",
"on",
"the",
"cluster",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L366-L437 | [
"def",
"import_file",
"(",
"path",
"=",
"None",
",",
"destination_frame",
"=",
"None",
",",
"parse",
"=",
"True",
",",
"header",
"=",
"0",
",",
"sep",
"=",
"None",
",",
"col_names",
"=",
"None",
",",
"col_types",
"=",
"None",
",",
"na_strings",
"=",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | import_hive_table | Import Hive table to H2OFrame in memory.
Make sure to start H2O with Hive on classpath. Uses hive-site.xml on classpath to connect to Hive.
:param database: Name of Hive database (default database will be used by default)
:param table: name of Hive table to import
:param partitions: a list of lists of... | h2o-py/h2o/h2o.py | def import_hive_table(database=None, table=None, partitions=None, allow_multi_format=False):
"""
Import Hive table to H2OFrame in memory.
Make sure to start H2O with Hive on classpath. Uses hive-site.xml on classpath to connect to Hive.
:param database: Name of Hive database (default database will be ... | def import_hive_table(database=None, table=None, partitions=None, allow_multi_format=False):
"""
Import Hive table to H2OFrame in memory.
Make sure to start H2O with Hive on classpath. Uses hive-site.xml on classpath to connect to Hive.
:param database: Name of Hive database (default database will be ... | [
"Import",
"Hive",
"table",
"to",
"H2OFrame",
"in",
"memory",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L440-L462 | [
"def",
"import_hive_table",
"(",
"database",
"=",
"None",
",",
"table",
"=",
"None",
",",
"partitions",
"=",
"None",
",",
"allow_multi_format",
"=",
"False",
")",
":",
"assert_is_type",
"(",
"database",
",",
"str",
",",
"None",
")",
"assert_is_type",
"(",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | import_sql_table | Import SQL table to H2OFrame in memory.
Assumes that the SQL table is not being updated and is stable.
Runs multiple SELECT SQL queries concurrently for parallel ingestion.
Be sure to start the h2o.jar in the terminal with your downloaded JDBC driver in the classpath::
java -cp <path_to_h2o_jar>:<... | h2o-py/h2o/h2o.py | def import_sql_table(connection_url, table, username, password, columns=None, optimize=True, fetch_mode=None):
"""
Import SQL table to H2OFrame in memory.
Assumes that the SQL table is not being updated and is stable.
Runs multiple SELECT SQL queries concurrently for parallel ingestion.
Be sure to ... | def import_sql_table(connection_url, table, username, password, columns=None, optimize=True, fetch_mode=None):
"""
Import SQL table to H2OFrame in memory.
Assumes that the SQL table is not being updated and is stable.
Runs multiple SELECT SQL queries concurrently for parallel ingestion.
Be sure to ... | [
"Import",
"SQL",
"table",
"to",
"H2OFrame",
"in",
"memory",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L464-L508 | [
"def",
"import_sql_table",
"(",
"connection_url",
",",
"table",
",",
"username",
",",
"password",
",",
"columns",
"=",
"None",
",",
"optimize",
"=",
"True",
",",
"fetch_mode",
"=",
"None",
")",
":",
"assert_is_type",
"(",
"connection_url",
",",
"str",
")",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | import_sql_select | Import the SQL table that is the result of the specified SQL query to H2OFrame in memory.
Creates a temporary SQL table from the specified sql_query.
Runs multiple SELECT SQL queries on the temporary table concurrently for parallel ingestion, then drops the table.
Be sure to start the h2o.jar in the termin... | h2o-py/h2o/h2o.py | def import_sql_select(connection_url, select_query, username, password, optimize=True,
use_temp_table=None, temp_table_name=None, fetch_mode=None):
"""
Import the SQL table that is the result of the specified SQL query to H2OFrame in memory.
Creates a temporary SQL table from the spe... | def import_sql_select(connection_url, select_query, username, password, optimize=True,
use_temp_table=None, temp_table_name=None, fetch_mode=None):
"""
Import the SQL table that is the result of the specified SQL query to H2OFrame in memory.
Creates a temporary SQL table from the spe... | [
"Import",
"the",
"SQL",
"table",
"that",
"is",
"the",
"result",
"of",
"the",
"specified",
"SQL",
"query",
"to",
"H2OFrame",
"in",
"memory",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L511-L557 | [
"def",
"import_sql_select",
"(",
"connection_url",
",",
"select_query",
",",
"username",
",",
"password",
",",
"optimize",
"=",
"True",
",",
"use_temp_table",
"=",
"None",
",",
"temp_table_name",
"=",
"None",
",",
"fetch_mode",
"=",
"None",
")",
":",
"assert_i... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | parse_setup | Retrieve H2O's best guess as to what the structure of the data file is.
During parse setup, the H2O cluster will make several guesses about the attributes of
the data. This method allows a user to perform corrective measures by updating the
returning dictionary from this method. This dictionary is then fed... | h2o-py/h2o/h2o.py | def parse_setup(raw_frames, destination_frame=None, header=0, separator=None, column_names=None,
column_types=None, na_strings=None, skipped_columns=None, custom_non_data_line_markers=None):
"""
Retrieve H2O's best guess as to what the structure of the data file is.
During parse setup, the ... | def parse_setup(raw_frames, destination_frame=None, header=0, separator=None, column_names=None,
column_types=None, na_strings=None, skipped_columns=None, custom_non_data_line_markers=None):
"""
Retrieve H2O's best guess as to what the structure of the data file is.
During parse setup, the ... | [
"Retrieve",
"H2O",
"s",
"best",
"guess",
"as",
"to",
"what",
"the",
"structure",
"of",
"the",
"data",
"file",
"is",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L560-L728 | [
"def",
"parse_setup",
"(",
"raw_frames",
",",
"destination_frame",
"=",
"None",
",",
"header",
"=",
"0",
",",
"separator",
"=",
"None",
",",
"column_names",
"=",
"None",
",",
"column_types",
"=",
"None",
",",
"na_strings",
"=",
"None",
",",
"skipped_columns"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | parse_raw | Parse dataset using the parse setup structure.
:param setup: Result of ``h2o.parse_setup()``
:param id: an id for the frame.
:param first_line_is_header: -1, 0, 1 if the first line is to be used as the header
:returns: an :class:`H2OFrame` object. | h2o-py/h2o/h2o.py | def parse_raw(setup, id=None, first_line_is_header=0):
"""
Parse dataset using the parse setup structure.
:param setup: Result of ``h2o.parse_setup()``
:param id: an id for the frame.
:param first_line_is_header: -1, 0, 1 if the first line is to be used as the header
:returns: an :class:`H2OFr... | def parse_raw(setup, id=None, first_line_is_header=0):
"""
Parse dataset using the parse setup structure.
:param setup: Result of ``h2o.parse_setup()``
:param id: an id for the frame.
:param first_line_is_header: -1, 0, 1 if the first line is to be used as the header
:returns: an :class:`H2OFr... | [
"Parse",
"dataset",
"using",
"the",
"parse",
"setup",
"structure",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L731-L752 | [
"def",
"parse_raw",
"(",
"setup",
",",
"id",
"=",
"None",
",",
"first_line_is_header",
"=",
"0",
")",
":",
"assert_is_type",
"(",
"setup",
",",
"dict",
")",
"assert_is_type",
"(",
"id",
",",
"str",
",",
"None",
")",
"assert_is_type",
"(",
"first_line_is_he... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | assign | (internal) Assign new id to the frame.
:param data: an H2OFrame whose id should be changed
:param xid: new id for the frame.
:returns: the passed frame. | h2o-py/h2o/h2o.py | def assign(data, xid):
"""
(internal) Assign new id to the frame.
:param data: an H2OFrame whose id should be changed
:param xid: new id for the frame.
:returns: the passed frame.
"""
assert_is_type(data, H2OFrame)
assert_is_type(xid, str)
assert_satisfies(xid, xid != data.frame_id)... | def assign(data, xid):
"""
(internal) Assign new id to the frame.
:param data: an H2OFrame whose id should be changed
:param xid: new id for the frame.
:returns: the passed frame.
"""
assert_is_type(data, H2OFrame)
assert_is_type(xid, str)
assert_satisfies(xid, xid != data.frame_id)... | [
"(",
"internal",
")",
"Assign",
"new",
"id",
"to",
"the",
"frame",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L755-L770 | [
"def",
"assign",
"(",
"data",
",",
"xid",
")",
":",
"assert_is_type",
"(",
"data",
",",
"H2OFrame",
")",
"assert_is_type",
"(",
"xid",
",",
"str",
")",
"assert_satisfies",
"(",
"xid",
",",
"xid",
"!=",
"data",
".",
"frame_id",
")",
"check_frame_id",
"(",... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | deep_copy | Create a deep clone of the frame ``data``.
:param data: an H2OFrame to be cloned
:param xid: (internal) id to be assigned to the new frame.
:returns: new :class:`H2OFrame` which is the clone of the passed frame. | h2o-py/h2o/h2o.py | def deep_copy(data, xid):
"""
Create a deep clone of the frame ``data``.
:param data: an H2OFrame to be cloned
:param xid: (internal) id to be assigned to the new frame.
:returns: new :class:`H2OFrame` which is the clone of the passed frame.
"""
assert_is_type(data, H2OFrame)
assert_is_... | def deep_copy(data, xid):
"""
Create a deep clone of the frame ``data``.
:param data: an H2OFrame to be cloned
:param xid: (internal) id to be assigned to the new frame.
:returns: new :class:`H2OFrame` which is the clone of the passed frame.
"""
assert_is_type(data, H2OFrame)
assert_is_... | [
"Create",
"a",
"deep",
"clone",
"of",
"the",
"frame",
"data",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L773-L789 | [
"def",
"deep_copy",
"(",
"data",
",",
"xid",
")",
":",
"assert_is_type",
"(",
"data",
",",
"H2OFrame",
")",
"assert_is_type",
"(",
"xid",
",",
"str",
")",
"assert_satisfies",
"(",
"xid",
",",
"xid",
"!=",
"data",
".",
"frame_id",
")",
"check_frame_id",
"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | get_model | Load a model from the server.
:param model_id: The model identification in H2O
:returns: Model object, a subclass of H2OEstimator | h2o-py/h2o/h2o.py | def get_model(model_id):
"""
Load a model from the server.
:param model_id: The model identification in H2O
:returns: Model object, a subclass of H2OEstimator
"""
assert_is_type(model_id, str)
model_json = api("GET /3/Models/%s" % model_id)["models"][0]
algo = model_json["algo"]
if... | def get_model(model_id):
"""
Load a model from the server.
:param model_id: The model identification in H2O
:returns: Model object, a subclass of H2OEstimator
"""
assert_is_type(model_id, str)
model_json = api("GET /3/Models/%s" % model_id)["models"][0]
algo = model_json["algo"]
if... | [
"Load",
"a",
"model",
"from",
"the",
"server",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L792-L825 | [
"def",
"get_model",
"(",
"model_id",
")",
":",
"assert_is_type",
"(",
"model_id",
",",
"str",
")",
"model_json",
"=",
"api",
"(",
"\"GET /3/Models/%s\"",
"%",
"model_id",
")",
"[",
"\"models\"",
"]",
"[",
"0",
"]",
"algo",
"=",
"model_json",
"[",
"\"algo\"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | get_grid | Return the specified grid.
:param grid_id: The grid identification in h2o
:returns: an :class:`H2OGridSearch` instance. | h2o-py/h2o/h2o.py | def get_grid(grid_id):
"""
Return the specified grid.
:param grid_id: The grid identification in h2o
:returns: an :class:`H2OGridSearch` instance.
"""
assert_is_type(grid_id, str)
grid_json = api("GET /99/Grids/%s" % grid_id)
models = [get_model(key["name"]) for key in grid_json["model... | def get_grid(grid_id):
"""
Return the specified grid.
:param grid_id: The grid identification in h2o
:returns: an :class:`H2OGridSearch` instance.
"""
assert_is_type(grid_id, str)
grid_json = api("GET /99/Grids/%s" % grid_id)
models = [get_model(key["name"]) for key in grid_json["model... | [
"Return",
"the",
"specified",
"grid",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L828-L855 | [
"def",
"get_grid",
"(",
"grid_id",
")",
":",
"assert_is_type",
"(",
"grid_id",
",",
"str",
")",
"grid_json",
"=",
"api",
"(",
"\"GET /99/Grids/%s\"",
"%",
"grid_id",
")",
"models",
"=",
"[",
"get_model",
"(",
"key",
"[",
"\"name\"",
"]",
")",
"for",
"key... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | get_frame | Obtain a handle to the frame in H2O with the frame_id key.
:param str frame_id: id of the frame to retrieve.
:returns: an :class:`H2OFrame` object | h2o-py/h2o/h2o.py | def get_frame(frame_id, **kwargs):
"""
Obtain a handle to the frame in H2O with the frame_id key.
:param str frame_id: id of the frame to retrieve.
:returns: an :class:`H2OFrame` object
"""
assert_is_type(frame_id, str)
return H2OFrame.get_frame(frame_id, **kwargs) | def get_frame(frame_id, **kwargs):
"""
Obtain a handle to the frame in H2O with the frame_id key.
:param str frame_id: id of the frame to retrieve.
:returns: an :class:`H2OFrame` object
"""
assert_is_type(frame_id, str)
return H2OFrame.get_frame(frame_id, **kwargs) | [
"Obtain",
"a",
"handle",
"to",
"the",
"frame",
"in",
"H2O",
"with",
"the",
"frame_id",
"key",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L858-L866 | [
"def",
"get_frame",
"(",
"frame_id",
",",
"*",
"*",
"kwargs",
")",
":",
"assert_is_type",
"(",
"frame_id",
",",
"str",
")",
"return",
"H2OFrame",
".",
"get_frame",
"(",
"frame_id",
",",
"*",
"*",
"kwargs",
")"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | remove | Remove object(s) from H2O.
:param x: H2OFrame, H2OEstimator, or string, or a list of those things: the object(s) or unique id(s)
pointing to the object(s) to be removed. | h2o-py/h2o/h2o.py | def remove(x):
"""
Remove object(s) from H2O.
:param x: H2OFrame, H2OEstimator, or string, or a list of those things: the object(s) or unique id(s)
pointing to the object(s) to be removed.
"""
item_type = U(str, H2OFrame, H2OEstimator)
assert_is_type(x, item_type, [item_type])
if no... | def remove(x):
"""
Remove object(s) from H2O.
:param x: H2OFrame, H2OEstimator, or string, or a list of those things: the object(s) or unique id(s)
pointing to the object(s) to be removed.
"""
item_type = U(str, H2OFrame, H2OEstimator)
assert_is_type(x, item_type, [item_type])
if no... | [
"Remove",
"object",
"(",
"s",
")",
"from",
"H2O",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L908-L932 | [
"def",
"remove",
"(",
"x",
")",
":",
"item_type",
"=",
"U",
"(",
"str",
",",
"H2OFrame",
",",
"H2OEstimator",
")",
"assert_is_type",
"(",
"x",
",",
"item_type",
",",
"[",
"item_type",
"]",
")",
"if",
"not",
"isinstance",
"(",
"x",
",",
"list",
")",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | download_pojo | Download the POJO for this model to the directory specified by path; if path is "", then dump to screen.
:param model: the model whose scoring POJO should be retrieved.
:param path: an absolute path to the directory where POJO should be saved.
:param get_jar: retrieve the h2o-genmodel.jar also (will be sav... | h2o-py/h2o/h2o.py | def download_pojo(model, path="", get_jar=True, jar_name=""):
"""
Download the POJO for this model to the directory specified by path; if path is "", then dump to screen.
:param model: the model whose scoring POJO should be retrieved.
:param path: an absolute path to the directory where POJO should be ... | def download_pojo(model, path="", get_jar=True, jar_name=""):
"""
Download the POJO for this model to the directory specified by path; if path is "", then dump to screen.
:param model: the model whose scoring POJO should be retrieved.
:param path: an absolute path to the directory where POJO should be ... | [
"Download",
"the",
"POJO",
"for",
"this",
"model",
"to",
"the",
"directory",
"specified",
"by",
"path",
";",
"if",
"path",
"is",
"then",
"dump",
"to",
"screen",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L978-L1006 | [
"def",
"download_pojo",
"(",
"model",
",",
"path",
"=",
"\"\"",
",",
"get_jar",
"=",
"True",
",",
"jar_name",
"=",
"\"\"",
")",
":",
"assert_is_type",
"(",
"model",
",",
"ModelBase",
")",
"assert_is_type",
"(",
"path",
",",
"str",
")",
"assert_is_type",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | download_csv | Download an H2O data set to a CSV file on the local disk.
Warning: Files located on the H2O server may be very large! Make sure you have enough
hard drive space to accommodate the entire file.
:param data: an H2OFrame object to be downloaded.
:param filename: name for the CSV file where the data shoul... | h2o-py/h2o/h2o.py | def download_csv(data, filename):
"""
Download an H2O data set to a CSV file on the local disk.
Warning: Files located on the H2O server may be very large! Make sure you have enough
hard drive space to accommodate the entire file.
:param data: an H2OFrame object to be downloaded.
:param filena... | def download_csv(data, filename):
"""
Download an H2O data set to a CSV file on the local disk.
Warning: Files located on the H2O server may be very large! Make sure you have enough
hard drive space to accommodate the entire file.
:param data: an H2OFrame object to be downloaded.
:param filena... | [
"Download",
"an",
"H2O",
"data",
"set",
"to",
"a",
"CSV",
"file",
"on",
"the",
"local",
"disk",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L1009-L1023 | [
"def",
"download_csv",
"(",
"data",
",",
"filename",
")",
":",
"assert_is_type",
"(",
"data",
",",
"H2OFrame",
")",
"assert_is_type",
"(",
"filename",
",",
"str",
")",
"url",
"=",
"h2oconn",
".",
"make_url",
"(",
"\"DownloadDataset\"",
",",
"3",
")",
"+",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | download_all_logs | Download H2O log files to disk.
:param dirname: a character string indicating the directory that the log file should be saved in.
:param filename: a string indicating the name that the CSV file should be. Note that the saved format is .zip, so the file name must include the .zip extension.
:returns: path ... | h2o-py/h2o/h2o.py | def download_all_logs(dirname=".", filename=None):
"""
Download H2O log files to disk.
:param dirname: a character string indicating the directory that the log file should be saved in.
:param filename: a string indicating the name that the CSV file should be. Note that the saved format is .zip, so the ... | def download_all_logs(dirname=".", filename=None):
"""
Download H2O log files to disk.
:param dirname: a character string indicating the directory that the log file should be saved in.
:param filename: a string indicating the name that the CSV file should be. Note that the saved format is .zip, so the ... | [
"Download",
"H2O",
"log",
"files",
"to",
"disk",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L1026-L1062 | [
"def",
"download_all_logs",
"(",
"dirname",
"=",
"\".\"",
",",
"filename",
"=",
"None",
")",
":",
"assert_is_type",
"(",
"dirname",
",",
"str",
")",
"assert_is_type",
"(",
"filename",
",",
"str",
",",
"None",
")",
"url",
"=",
"\"%s/3/Logs/download\"",
"%",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | save_model | Save an H2O Model object to disk. (Note that ensemble binary models can now be saved using this method.)
:param model: The model object to save.
:param path: a path to save the model at (hdfs, s3, local)
:param force: if True overwrite destination directory in case it exists, or throw exception if set to F... | h2o-py/h2o/h2o.py | def save_model(model, path="", force=False):
"""
Save an H2O Model object to disk. (Note that ensemble binary models can now be saved using this method.)
:param model: The model object to save.
:param path: a path to save the model at (hdfs, s3, local)
:param force: if True overwrite destination di... | def save_model(model, path="", force=False):
"""
Save an H2O Model object to disk. (Note that ensemble binary models can now be saved using this method.)
:param model: The model object to save.
:param path: a path to save the model at (hdfs, s3, local)
:param force: if True overwrite destination di... | [
"Save",
"an",
"H2O",
"Model",
"object",
"to",
"disk",
".",
"(",
"Note",
"that",
"ensemble",
"binary",
"models",
"can",
"now",
"be",
"saved",
"using",
"this",
"method",
".",
")"
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L1065-L1082 | [
"def",
"save_model",
"(",
"model",
",",
"path",
"=",
"\"\"",
",",
"force",
"=",
"False",
")",
":",
"assert_is_type",
"(",
"model",
",",
"ModelBase",
")",
"assert_is_type",
"(",
"path",
",",
"str",
")",
"assert_is_type",
"(",
"force",
",",
"bool",
")",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | load_model | Load a saved H2O model from disk. (Note that ensemble binary models can now be loaded using this method.)
:param path: the full path of the H2O Model to be imported.
:returns: an :class:`H2OEstimator` object
:examples:
>>> path = h2o.save_model(my_model, dir=my_path)
>>> h2o.load_model(pa... | h2o-py/h2o/h2o.py | def load_model(path):
"""
Load a saved H2O model from disk. (Note that ensemble binary models can now be loaded using this method.)
:param path: the full path of the H2O Model to be imported.
:returns: an :class:`H2OEstimator` object
:examples:
>>> path = h2o.save_model(my_model, dir=my_p... | def load_model(path):
"""
Load a saved H2O model from disk. (Note that ensemble binary models can now be loaded using this method.)
:param path: the full path of the H2O Model to be imported.
:returns: an :class:`H2OEstimator` object
:examples:
>>> path = h2o.save_model(my_model, dir=my_p... | [
"Load",
"a",
"saved",
"H2O",
"model",
"from",
"disk",
".",
"(",
"Note",
"that",
"ensemble",
"binary",
"models",
"can",
"now",
"be",
"loaded",
"using",
"this",
"method",
".",
")"
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L1085-L1099 | [
"def",
"load_model",
"(",
"path",
")",
":",
"assert_is_type",
"(",
"path",
",",
"str",
")",
"res",
"=",
"api",
"(",
"\"POST /99/Models.bin/%s\"",
"%",
"\"\"",
",",
"data",
"=",
"{",
"\"dir\"",
":",
"path",
"}",
")",
"return",
"get_model",
"(",
"res",
"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | export_file | Export a given H2OFrame to a path on the machine this python session is currently connected to.
:param frame: the Frame to save to disk.
:param path: the path to the save point on disk.
:param force: if True, overwrite any preexisting file with the same path
:param parts: enables export to multiple 'pa... | h2o-py/h2o/h2o.py | def export_file(frame, path, force=False, parts=1):
"""
Export a given H2OFrame to a path on the machine this python session is currently connected to.
:param frame: the Frame to save to disk.
:param path: the path to the save point on disk.
:param force: if True, overwrite any preexisting file wit... | def export_file(frame, path, force=False, parts=1):
"""
Export a given H2OFrame to a path on the machine this python session is currently connected to.
:param frame: the Frame to save to disk.
:param path: the path to the save point on disk.
:param force: if True, overwrite any preexisting file wit... | [
"Export",
"a",
"given",
"H2OFrame",
"to",
"a",
"path",
"on",
"the",
"machine",
"this",
"python",
"session",
"is",
"currently",
"connected",
"to",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L1102-L1121 | [
"def",
"export_file",
"(",
"frame",
",",
"path",
",",
"force",
"=",
"False",
",",
"parts",
"=",
"1",
")",
":",
"assert_is_type",
"(",
"frame",
",",
"H2OFrame",
")",
"assert_is_type",
"(",
"path",
",",
"str",
")",
"assert_is_type",
"(",
"force",
",",
"b... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | create_frame | Create a new frame with random data.
Creates a data frame in H2O with real-valued, categorical, integer, and binary columns specified by the user.
:param frame_id: the destination key. If empty, this will be auto-generated.
:param rows: the number of rows of data to generate.
:param cols: the number o... | h2o-py/h2o/h2o.py | def create_frame(frame_id=None, rows=10000, cols=10, randomize=True,
real_fraction=None, categorical_fraction=None, integer_fraction=None,
binary_fraction=None, time_fraction=None, string_fraction=None,
value=0, real_range=100, factors=100, integer_range=100,
... | def create_frame(frame_id=None, rows=10000, cols=10, randomize=True,
real_fraction=None, categorical_fraction=None, integer_fraction=None,
binary_fraction=None, time_fraction=None, string_fraction=None,
value=0, real_range=100, factors=100, integer_range=100,
... | [
"Create",
"a",
"new",
"frame",
"with",
"random",
"data",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L1130-L1258 | [
"def",
"create_frame",
"(",
"frame_id",
"=",
"None",
",",
"rows",
"=",
"10000",
",",
"cols",
"=",
"10",
",",
"randomize",
"=",
"True",
",",
"real_fraction",
"=",
"None",
",",
"categorical_fraction",
"=",
"None",
",",
"integer_fraction",
"=",
"None",
",",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | interaction | Categorical Interaction Feature Creation in H2O.
Creates a frame in H2O with n-th order interaction features between categorical columns, as specified by
the user.
:param data: the H2OFrame that holds the target categorical columns.
:param factors: factor columns (either indices or column names).
... | h2o-py/h2o/h2o.py | def interaction(data, factors, pairwise, max_factors, min_occurrence, destination_frame=None):
"""
Categorical Interaction Feature Creation in H2O.
Creates a frame in H2O with n-th order interaction features between categorical columns, as specified by
the user.
:param data: the H2OFrame that hold... | def interaction(data, factors, pairwise, max_factors, min_occurrence, destination_frame=None):
"""
Categorical Interaction Feature Creation in H2O.
Creates a frame in H2O with n-th order interaction features between categorical columns, as specified by
the user.
:param data: the H2OFrame that hold... | [
"Categorical",
"Interaction",
"Feature",
"Creation",
"in",
"H2O",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L1261-L1294 | [
"def",
"interaction",
"(",
"data",
",",
"factors",
",",
"pairwise",
",",
"max_factors",
",",
"min_occurrence",
",",
"destination_frame",
"=",
"None",
")",
":",
"assert_is_type",
"(",
"data",
",",
"H2OFrame",
")",
"assert_is_type",
"(",
"factors",
",",
"[",
"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | as_list | Convert an H2O data object into a python-specific object.
WARNING! This will pull all data local!
If Pandas is available (and use_pandas is True), then pandas will be used to parse the
data frame. Otherwise, a list-of-lists populated by character data will be returned (so
the types of data will all be... | h2o-py/h2o/h2o.py | def as_list(data, use_pandas=True, header=True):
"""
Convert an H2O data object into a python-specific object.
WARNING! This will pull all data local!
If Pandas is available (and use_pandas is True), then pandas will be used to parse the
data frame. Otherwise, a list-of-lists populated by characte... | def as_list(data, use_pandas=True, header=True):
"""
Convert an H2O data object into a python-specific object.
WARNING! This will pull all data local!
If Pandas is available (and use_pandas is True), then pandas will be used to parse the
data frame. Otherwise, a list-of-lists populated by characte... | [
"Convert",
"an",
"H2O",
"data",
"object",
"into",
"a",
"python",
"-",
"specific",
"object",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L1297-L1316 | [
"def",
"as_list",
"(",
"data",
",",
"use_pandas",
"=",
"True",
",",
"header",
"=",
"True",
")",
":",
"assert_is_type",
"(",
"data",
",",
"H2OFrame",
")",
"assert_is_type",
"(",
"use_pandas",
",",
"bool",
")",
"assert_is_type",
"(",
"header",
",",
"bool",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | demo | H2O built-in demo facility.
:param funcname: A string that identifies the h2o python function to demonstrate.
:param interactive: If True, the user will be prompted to continue the demonstration after every segment.
:param echo: If True, the python commands that are executed will be displayed.
:param t... | h2o-py/h2o/h2o.py | def demo(funcname, interactive=True, echo=True, test=False):
"""
H2O built-in demo facility.
:param funcname: A string that identifies the h2o python function to demonstrate.
:param interactive: If True, the user will be prompted to continue the demonstration after every segment.
:param echo: If Tr... | def demo(funcname, interactive=True, echo=True, test=False):
"""
H2O built-in demo facility.
:param funcname: A string that identifies the h2o python function to demonstrate.
:param interactive: If True, the user will be prompted to continue the demonstration after every segment.
:param echo: If Tr... | [
"H2O",
"built",
"-",
"in",
"demo",
"facility",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L1319-L1342 | [
"def",
"demo",
"(",
"funcname",
",",
"interactive",
"=",
"True",
",",
"echo",
"=",
"True",
",",
"test",
"=",
"False",
")",
":",
"import",
"h2o",
".",
"demos",
"as",
"h2odemo",
"assert_is_type",
"(",
"funcname",
",",
"str",
")",
"assert_is_type",
"(",
"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | load_dataset | Imports a data file within the 'h2o_data' folder. | h2o-py/h2o/h2o.py | def load_dataset(relative_path):
"""Imports a data file within the 'h2o_data' folder."""
assert_is_type(relative_path, str)
h2o_dir = os.path.split(__file__)[0]
for possible_file in [os.path.join(h2o_dir, relative_path),
os.path.join(h2o_dir, "h2o_data", relative_path),
... | def load_dataset(relative_path):
"""Imports a data file within the 'h2o_data' folder."""
assert_is_type(relative_path, str)
h2o_dir = os.path.split(__file__)[0]
for possible_file in [os.path.join(h2o_dir, relative_path),
os.path.join(h2o_dir, "h2o_data", relative_path),
... | [
"Imports",
"a",
"data",
"file",
"within",
"the",
"h2o_data",
"folder",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L1345-L1355 | [
"def",
"load_dataset",
"(",
"relative_path",
")",
":",
"assert_is_type",
"(",
"relative_path",
",",
"str",
")",
"h2o_dir",
"=",
"os",
".",
"path",
".",
"split",
"(",
"__file__",
")",
"[",
"0",
"]",
"for",
"possible_file",
"in",
"[",
"os",
".",
"path",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | make_metrics | Create Model Metrics from predicted and actual values in H2O.
:param H2OFrame predicted: an H2OFrame containing predictions.
:param H2OFrame actuals: an H2OFrame containing actual values.
:param domain: list of response factors for classification.
:param distribution: distribution for regression. | h2o-py/h2o/h2o.py | def make_metrics(predicted, actual, domain=None, distribution=None):
"""
Create Model Metrics from predicted and actual values in H2O.
:param H2OFrame predicted: an H2OFrame containing predictions.
:param H2OFrame actuals: an H2OFrame containing actual values.
:param domain: list of response factor... | def make_metrics(predicted, actual, domain=None, distribution=None):
"""
Create Model Metrics from predicted and actual values in H2O.
:param H2OFrame predicted: an H2OFrame containing predictions.
:param H2OFrame actuals: an H2OFrame containing actual values.
:param domain: list of response factor... | [
"Create",
"Model",
"Metrics",
"from",
"predicted",
"and",
"actual",
"values",
"in",
"H2O",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L1358-L1377 | [
"def",
"make_metrics",
"(",
"predicted",
",",
"actual",
",",
"domain",
"=",
"None",
",",
"distribution",
"=",
"None",
")",
":",
"assert_is_type",
"(",
"predicted",
",",
"H2OFrame",
")",
"assert_is_type",
"(",
"actual",
",",
"H2OFrame",
")",
"# assert predicted... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | _put_key | Upload given file into DKV and save it under give key as raw object.
:param dest_key: name of destination key in DKV
:param file_path: path to file to upload
:return: key name if object was uploaded successfully | h2o-py/h2o/h2o.py | def _put_key(file_path, dest_key=None, overwrite=True):
"""
Upload given file into DKV and save it under give key as raw object.
:param dest_key: name of destination key in DKV
:param file_path: path to file to upload
:return: key name if object was uploaded successfully
"""
ret = api("PO... | def _put_key(file_path, dest_key=None, overwrite=True):
"""
Upload given file into DKV and save it under give key as raw object.
:param dest_key: name of destination key in DKV
:param file_path: path to file to upload
:return: key name if object was uploaded successfully
"""
ret = api("PO... | [
"Upload",
"given",
"file",
"into",
"DKV",
"and",
"save",
"it",
"under",
"give",
"key",
"as",
"raw",
"object",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L1388-L1398 | [
"def",
"_put_key",
"(",
"file_path",
",",
"dest_key",
"=",
"None",
",",
"overwrite",
"=",
"True",
")",
":",
"ret",
"=",
"api",
"(",
"\"POST /3/PutKey?destination_key={}&overwrite={}\"",
".",
"format",
"(",
"dest_key",
"if",
"dest_key",
"else",
"''",
",",
"over... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | upload_custom_metric | Upload given metrics function into H2O cluster.
The metrics can have different representation:
- class: needs to implement map(pred, act, weight, offset, model), reduce(l, r) and metric(l) methods
- string: the same as in class case, but the class is given as a string
:param func: metric represen... | h2o-py/h2o/h2o.py | def upload_custom_metric(func, func_file="metrics.py", func_name=None, class_name=None, source_provider=None):
"""
Upload given metrics function into H2O cluster.
The metrics can have different representation:
- class: needs to implement map(pred, act, weight, offset, model), reduce(l, r) and metric(... | def upload_custom_metric(func, func_file="metrics.py", func_name=None, class_name=None, source_provider=None):
"""
Upload given metrics function into H2O cluster.
The metrics can have different representation:
- class: needs to implement map(pred, act, weight, offset, model), reduce(l, r) and metric(... | [
"Upload",
"given",
"metrics",
"function",
"into",
"H2O",
"cluster",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/h2o.py#L1430-L1531 | [
"def",
"upload_custom_metric",
"(",
"func",
",",
"func_file",
"=",
"\"metrics.py\"",
",",
"func_name",
"=",
"None",
",",
"class_name",
"=",
"None",
",",
"source_provider",
"=",
"None",
")",
":",
"import",
"tempfile",
"import",
"inspect",
"# Use default source prov... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | main | Main program.
@return: none | scripts/grabGLRMJenkinRunResults.py | def main(argv):
"""
Main program.
@return: none
"""
global g_log_base_dir
global g_airline_java
global g_milsongs_java
global g_airline_python
global g_milsongs_python
if len(argv) < 2:
print "python grabGLRMrunLogs logsBaseDirectory\n"
sys.exit(1)
else: #... | def main(argv):
"""
Main program.
@return: none
"""
global g_log_base_dir
global g_airline_java
global g_milsongs_java
global g_airline_python
global g_milsongs_python
if len(argv) < 2:
print "python grabGLRMrunLogs logsBaseDirectory\n"
sys.exit(1)
else: #... | [
"Main",
"program",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/grabGLRMJenkinRunResults.py#L199-L255 | [
"def",
"main",
"(",
"argv",
")",
":",
"global",
"g_log_base_dir",
"global",
"g_airline_java",
"global",
"g_milsongs_java",
"global",
"g_airline_python",
"global",
"g_milsongs_python",
"if",
"len",
"(",
"argv",
")",
"<",
"2",
":",
"print",
"\"python grabGLRMrunLogs l... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | main | Main program.
@return: none | h2o-r/scripts/build_minicran.py | def main(argv):
"""
Main program.
@return: none
"""
global g_script_name
global g_tmp_dir
g_script_name = os.path.basename(argv[0])
# Override any defaults with the user's choices.
parse_args(argv)
# Create tmp dir and clean up on exit with a callback.
g_tmp_dir = tempfil... | def main(argv):
"""
Main program.
@return: none
"""
global g_script_name
global g_tmp_dir
g_script_name = os.path.basename(argv[0])
# Override any defaults with the user's choices.
parse_args(argv)
# Create tmp dir and clean up on exit with a callback.
g_tmp_dir = tempfil... | [
"Main",
"program",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-r/scripts/build_minicran.py#L400-L425 | [
"def",
"main",
"(",
"argv",
")",
":",
"global",
"g_script_name",
"global",
"g_tmp_dir",
"g_script_name",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"argv",
"[",
"0",
"]",
")",
"# Override any defaults with the user's choices.",
"parse_args",
"(",
"argv",
")",... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | check_frame_id | Check that the provided frame id is valid in Rapids language. | h2o-py/h2o/utils/shared_utils.py | def check_frame_id(frame_id):
"""Check that the provided frame id is valid in Rapids language."""
if frame_id is None:
return
if frame_id.strip() == "":
raise H2OValueError("Frame id cannot be an empty string: %r" % frame_id)
for i, ch in enumerate(frame_id):
# '$' character has ... | def check_frame_id(frame_id):
"""Check that the provided frame id is valid in Rapids language."""
if frame_id is None:
return
if frame_id.strip() == "":
raise H2OValueError("Frame id cannot be an empty string: %r" % frame_id)
for i, ch in enumerate(frame_id):
# '$' character has ... | [
"Check",
"that",
"the",
"provided",
"frame",
"id",
"is",
"valid",
"in",
"Rapids",
"language",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/shared_utils.py#L46-L58 | [
"def",
"check_frame_id",
"(",
"frame_id",
")",
":",
"if",
"frame_id",
"is",
"None",
":",
"return",
"if",
"frame_id",
".",
"strip",
"(",
")",
"==",
"\"\"",
":",
"raise",
"H2OValueError",
"(",
"\"Frame id cannot be an empty string: %r\"",
"%",
"frame_id",
")",
"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | _locate | Search for a relative path and turn it into an absolute path.
This is handy when hunting for data files to be passed into h2o and used by import file.
Note: This function is for unit testing purposes only.
Parameters
----------
path : str
Path to search for
:return: Absolute path if it i... | h2o-py/h2o/utils/shared_utils.py | def _locate(path):
"""Search for a relative path and turn it into an absolute path.
This is handy when hunting for data files to be passed into h2o and used by import file.
Note: This function is for unit testing purposes only.
Parameters
----------
path : str
Path to search for
:ret... | def _locate(path):
"""Search for a relative path and turn it into an absolute path.
This is handy when hunting for data files to be passed into h2o and used by import file.
Note: This function is for unit testing purposes only.
Parameters
----------
path : str
Path to search for
:ret... | [
"Search",
"for",
"a",
"relative",
"path",
"and",
"turn",
"it",
"into",
"an",
"absolute",
"path",
".",
"This",
"is",
"handy",
"when",
"hunting",
"for",
"data",
"files",
"to",
"be",
"passed",
"into",
"h2o",
"and",
"used",
"by",
"import",
"file",
".",
"No... | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/shared_utils.py#L220-L244 | [
"def",
"_locate",
"(",
"path",
")",
":",
"tmp_dir",
"=",
"os",
".",
"path",
".",
"realpath",
"(",
"os",
".",
"getcwd",
"(",
")",
")",
"possible_result",
"=",
"os",
".",
"path",
".",
"join",
"(",
"tmp_dir",
",",
"path",
")",
"while",
"True",
":",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | get_human_readable_bytes | Convert given number of bytes into a human readable representation, i.e. add prefix such as kb, Mb, Gb,
etc. The `size` argument must be a non-negative integer.
:param size: integer representing byte size of something
:return: string representation of the size, in human-readable form | h2o-py/h2o/utils/shared_utils.py | def get_human_readable_bytes(size):
"""
Convert given number of bytes into a human readable representation, i.e. add prefix such as kb, Mb, Gb,
etc. The `size` argument must be a non-negative integer.
:param size: integer representing byte size of something
:return: string representation of the siz... | def get_human_readable_bytes(size):
"""
Convert given number of bytes into a human readable representation, i.e. add prefix such as kb, Mb, Gb,
etc. The `size` argument must be a non-negative integer.
:param size: integer representing byte size of something
:return: string representation of the siz... | [
"Convert",
"given",
"number",
"of",
"bytes",
"into",
"a",
"human",
"readable",
"representation",
"i",
".",
"e",
".",
"add",
"prefix",
"such",
"as",
"kb",
"Mb",
"Gb",
"etc",
".",
"The",
"size",
"argument",
"must",
"be",
"a",
"non",
"-",
"negative",
"int... | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/shared_utils.py#L253-L279 | [
"def",
"get_human_readable_bytes",
"(",
"size",
")",
":",
"if",
"size",
"==",
"0",
":",
"return",
"\"0\"",
"if",
"size",
"is",
"None",
":",
"return",
"\"\"",
"assert_is_type",
"(",
"size",
",",
"int",
")",
"assert",
"size",
">=",
"0",
",",
"\"`size` cann... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | get_human_readable_time | Convert given duration in milliseconds into a human-readable representation, i.e. hours, minutes, seconds,
etc. More specifically, the returned string may look like following:
1 day 3 hours 12 mins
3 days 0 hours 0 mins
8 hours 12 mins
34 mins 02 secs
13 secs
541 ms
... | h2o-py/h2o/utils/shared_utils.py | def get_human_readable_time(time_ms):
"""
Convert given duration in milliseconds into a human-readable representation, i.e. hours, minutes, seconds,
etc. More specifically, the returned string may look like following:
1 day 3 hours 12 mins
3 days 0 hours 0 mins
8 hours 12 mins
... | def get_human_readable_time(time_ms):
"""
Convert given duration in milliseconds into a human-readable representation, i.e. hours, minutes, seconds,
etc. More specifically, the returned string may look like following:
1 day 3 hours 12 mins
3 days 0 hours 0 mins
8 hours 12 mins
... | [
"Convert",
"given",
"duration",
"in",
"milliseconds",
"into",
"a",
"human",
"-",
"readable",
"representation",
"i",
".",
"e",
".",
"hours",
"minutes",
"seconds",
"etc",
".",
"More",
"specifically",
"the",
"returned",
"string",
"may",
"look",
"like",
"following... | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/shared_utils.py#L282-L328 | [
"def",
"get_human_readable_time",
"(",
"time_ms",
")",
":",
"millis",
"=",
"time_ms",
"%",
"1000",
"secs",
"=",
"(",
"time_ms",
"//",
"1000",
")",
"%",
"60",
"mins",
"=",
"(",
"time_ms",
"//",
"60000",
")",
"%",
"60",
"hours",
"=",
"(",
"time_ms",
"/... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | print2 | This function exists here ONLY because Sphinx.ext.autodoc gets into a bad state when seeing the print()
function. When in that state, autodoc doesn't display any errors or warnings, but instead completely
ignores the "bysource" member-order option. | h2o-py/h2o/utils/shared_utils.py | def print2(msg, flush=False, end="\n"):
"""
This function exists here ONLY because Sphinx.ext.autodoc gets into a bad state when seeing the print()
function. When in that state, autodoc doesn't display any errors or warnings, but instead completely
ignores the "bysource" member-order option.
"""
... | def print2(msg, flush=False, end="\n"):
"""
This function exists here ONLY because Sphinx.ext.autodoc gets into a bad state when seeing the print()
function. When in that state, autodoc doesn't display any errors or warnings, but instead completely
ignores the "bysource" member-order option.
"""
... | [
"This",
"function",
"exists",
"here",
"ONLY",
"because",
"Sphinx",
".",
"ext",
".",
"autodoc",
"gets",
"into",
"a",
"bad",
"state",
"when",
"seeing",
"the",
"print",
"()",
"function",
".",
"When",
"in",
"that",
"state",
"autodoc",
"doesn",
"t",
"display",
... | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/shared_utils.py#L331-L338 | [
"def",
"print2",
"(",
"msg",
",",
"flush",
"=",
"False",
",",
"end",
"=",
"\"\\n\"",
")",
":",
"print",
"(",
"msg",
",",
"end",
"=",
"end",
")",
"if",
"flush",
":",
"sys",
".",
"stdout",
".",
"flush",
"(",
")"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | normalize_slice | Return a "canonical" version of slice ``s``.
:param slice s: the original slice expression
:param total int: total number of elements in the collection sliced by ``s``
:return slice: a slice equivalent to ``s`` but not containing any negative indices or Nones. | h2o-py/h2o/utils/shared_utils.py | def normalize_slice(s, total):
"""
Return a "canonical" version of slice ``s``.
:param slice s: the original slice expression
:param total int: total number of elements in the collection sliced by ``s``
:return slice: a slice equivalent to ``s`` but not containing any negative indices or Nones.
... | def normalize_slice(s, total):
"""
Return a "canonical" version of slice ``s``.
:param slice s: the original slice expression
:param total int: total number of elements in the collection sliced by ``s``
:return slice: a slice equivalent to ``s`` but not containing any negative indices or Nones.
... | [
"Return",
"a",
"canonical",
"version",
"of",
"slice",
"s",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/shared_utils.py#L341-L352 | [
"def",
"normalize_slice",
"(",
"s",
",",
"total",
")",
":",
"newstart",
"=",
"0",
"if",
"s",
".",
"start",
"is",
"None",
"else",
"max",
"(",
"0",
",",
"s",
".",
"start",
"+",
"total",
")",
"if",
"s",
".",
"start",
"<",
"0",
"else",
"min",
"(",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | slice_is_normalized | Return True if slice ``s`` in "normalized" form. | h2o-py/h2o/utils/shared_utils.py | def slice_is_normalized(s):
"""Return True if slice ``s`` in "normalized" form."""
return (s.start is not None and s.stop is not None and s.step is not None and s.start <= s.stop) | def slice_is_normalized(s):
"""Return True if slice ``s`` in "normalized" form."""
return (s.start is not None and s.stop is not None and s.step is not None and s.start <= s.stop) | [
"Return",
"True",
"if",
"slice",
"s",
"in",
"normalized",
"form",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/shared_utils.py#L355-L357 | [
"def",
"slice_is_normalized",
"(",
"s",
")",
":",
"return",
"(",
"s",
".",
"start",
"is",
"not",
"None",
"and",
"s",
".",
"stop",
"is",
"not",
"None",
"and",
"s",
".",
"step",
"is",
"not",
"None",
"and",
"s",
".",
"start",
"<=",
"s",
".",
"stop",... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | mojo_predict_pandas | MOJO scoring function to take a Pandas frame and use MOJO model as zip file to score.
:param dataframe: Pandas frame to score.
:param mojo_zip_path: Path to MOJO zip downloaded from H2O.
:param genmodel_jar_path: Optional, path to genmodel jar file. If None (default) then the h2o-genmodel.jar in the same
... | h2o-py/h2o/utils/shared_utils.py | def mojo_predict_pandas(dataframe, mojo_zip_path, genmodel_jar_path=None, classpath=None, java_options=None, verbose=False):
"""
MOJO scoring function to take a Pandas frame and use MOJO model as zip file to score.
:param dataframe: Pandas frame to score.
:param mojo_zip_path: Path to MOJO zip download... | def mojo_predict_pandas(dataframe, mojo_zip_path, genmodel_jar_path=None, classpath=None, java_options=None, verbose=False):
"""
MOJO scoring function to take a Pandas frame and use MOJO model as zip file to score.
:param dataframe: Pandas frame to score.
:param mojo_zip_path: Path to MOJO zip download... | [
"MOJO",
"scoring",
"function",
"to",
"take",
"a",
"Pandas",
"frame",
"and",
"use",
"MOJO",
"model",
"as",
"zip",
"file",
"to",
"score",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/shared_utils.py#L379-L407 | [
"def",
"mojo_predict_pandas",
"(",
"dataframe",
",",
"mojo_zip_path",
",",
"genmodel_jar_path",
"=",
"None",
",",
"classpath",
"=",
"None",
",",
"java_options",
"=",
"None",
",",
"verbose",
"=",
"False",
")",
":",
"tmp_dir",
"=",
"tempfile",
".",
"mkdtemp",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | mojo_predict_csv | MOJO scoring function to take a CSV file and use MOJO model as zip file to score.
:param input_csv_path: Path to input CSV file.
:param mojo_zip_path: Path to MOJO zip downloaded from H2O.
:param output_csv_path: Optional, name of the output CSV file with computed predictions. If None (default), then
... | h2o-py/h2o/utils/shared_utils.py | def mojo_predict_csv(input_csv_path, mojo_zip_path, output_csv_path=None, genmodel_jar_path=None, classpath=None, java_options=None, verbose=False):
"""
MOJO scoring function to take a CSV file and use MOJO model as zip file to score.
:param input_csv_path: Path to input CSV file.
:param mojo_zip_path:... | def mojo_predict_csv(input_csv_path, mojo_zip_path, output_csv_path=None, genmodel_jar_path=None, classpath=None, java_options=None, verbose=False):
"""
MOJO scoring function to take a CSV file and use MOJO model as zip file to score.
:param input_csv_path: Path to input CSV file.
:param mojo_zip_path:... | [
"MOJO",
"scoring",
"function",
"to",
"take",
"a",
"CSV",
"file",
"and",
"use",
"MOJO",
"model",
"as",
"zip",
"file",
"to",
"score",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/shared_utils.py#L410-L491 | [
"def",
"mojo_predict_csv",
"(",
"input_csv_path",
",",
"mojo_zip_path",
",",
"output_csv_path",
"=",
"None",
",",
"genmodel_jar_path",
"=",
"None",
",",
"classpath",
"=",
"None",
",",
"java_options",
"=",
"None",
",",
"verbose",
"=",
"False",
")",
":",
"defaul... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | deprecated | The decorator to mark deprecated functions. | h2o-py/h2o/utils/shared_utils.py | def deprecated(message):
"""The decorator to mark deprecated functions."""
from traceback import extract_stack
assert message, "`message` argument in @deprecated is required."
def deprecated_decorator(fun):
def decorator_invisible(*args, **kwargs):
stack = extract_stack()
... | def deprecated(message):
"""The decorator to mark deprecated functions."""
from traceback import extract_stack
assert message, "`message` argument in @deprecated is required."
def deprecated_decorator(fun):
def decorator_invisible(*args, **kwargs):
stack = extract_stack()
... | [
"The",
"decorator",
"to",
"mark",
"deprecated",
"functions",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/shared_utils.py#L494-L514 | [
"def",
"deprecated",
"(",
"message",
")",
":",
"from",
"traceback",
"import",
"extract_stack",
"assert",
"message",
",",
"\"`message` argument in @deprecated is required.\"",
"def",
"deprecated_decorator",
"(",
"fun",
")",
":",
"def",
"decorator_invisible",
"(",
"*",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OGridSearch.join | Wait until grid finishes computing. | h2o-py/h2o/grid/grid_search.py | def join(self):
"""Wait until grid finishes computing."""
self._future = False
self._job.poll()
self._job = None | def join(self):
"""Wait until grid finishes computing."""
self._future = False
self._job.poll()
self._job = None | [
"Wait",
"until",
"grid",
"finishes",
"computing",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/grid/grid_search.py#L147-L151 | [
"def",
"join",
"(",
"self",
")",
":",
"self",
".",
"_future",
"=",
"False",
"self",
".",
"_job",
".",
"poll",
"(",
")",
"self",
".",
"_job",
"=",
"None"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OGridSearch.train | Train the model synchronously (i.e. do not return until the model finishes training).
To train asynchronously call :meth:`start`.
:param x: A list of column names or indices indicating the predictor columns.
:param y: An index or a column name indicating the response column.
:param tra... | h2o-py/h2o/grid/grid_search.py | def train(self, x=None, y=None, training_frame=None, offset_column=None, fold_column=None, weights_column=None,
validation_frame=None, **params):
"""
Train the model synchronously (i.e. do not return until the model finishes training).
To train asynchronously call :meth:`start`.
... | def train(self, x=None, y=None, training_frame=None, offset_column=None, fold_column=None, weights_column=None,
validation_frame=None, **params):
"""
Train the model synchronously (i.e. do not return until the model finishes training).
To train asynchronously call :meth:`start`.
... | [
"Train",
"the",
"model",
"synchronously",
"(",
"i",
".",
"e",
".",
"do",
"not",
"return",
"until",
"the",
"model",
"finishes",
"training",
")",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/grid/grid_search.py#L154-L209 | [
"def",
"train",
"(",
"self",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"training_frame",
"=",
"None",
",",
"offset_column",
"=",
"None",
",",
"fold_column",
"=",
"None",
",",
"weights_column",
"=",
"None",
",",
"validation_frame",
"=",
"None",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OGridSearch.build_model | (internal) | h2o-py/h2o/grid/grid_search.py | def build_model(self, algo_params):
"""(internal)"""
if algo_params["training_frame"] is None: raise ValueError("Missing training_frame")
x = algo_params.pop("x")
y = algo_params.pop("y", None)
training_frame = algo_params.pop("training_frame")
validation_frame = algo_par... | def build_model(self, algo_params):
"""(internal)"""
if algo_params["training_frame"] is None: raise ValueError("Missing training_frame")
x = algo_params.pop("x")
y = algo_params.pop("y", None)
training_frame = algo_params.pop("training_frame")
validation_frame = algo_par... | [
"(",
"internal",
")"
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/grid/grid_search.py#L212-L227 | [
"def",
"build_model",
"(",
"self",
",",
"algo_params",
")",
":",
"if",
"algo_params",
"[",
"\"training_frame\"",
"]",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Missing training_frame\"",
")",
"x",
"=",
"algo_params",
".",
"pop",
"(",
"\"x\"",
")",
"y... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OGridSearch.predict | Predict on a dataset.
:param H2OFrame test_data: Data to be predicted on.
:returns: H2OFrame filled with predictions. | h2o-py/h2o/grid/grid_search.py | def predict(self, test_data):
"""
Predict on a dataset.
:param H2OFrame test_data: Data to be predicted on.
:returns: H2OFrame filled with predictions.
"""
return {model.model_id: model.predict(test_data) for model in self.models} | def predict(self, test_data):
"""
Predict on a dataset.
:param H2OFrame test_data: Data to be predicted on.
:returns: H2OFrame filled with predictions.
"""
return {model.model_id: model.predict(test_data) for model in self.models} | [
"Predict",
"on",
"a",
"dataset",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/grid/grid_search.py#L322-L329 | [
"def",
"predict",
"(",
"self",
",",
"test_data",
")",
":",
"return",
"{",
"model",
".",
"model_id",
":",
"model",
".",
"predict",
"(",
"test_data",
")",
"for",
"model",
"in",
"self",
".",
"models",
"}"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OGridSearch.get_xval_models | Return a Model object.
:param str key: If None, return all cross-validated models; otherwise return the model
specified by the key.
:returns: A model or a list of models. | h2o-py/h2o/grid/grid_search.py | def get_xval_models(self, key=None):
"""
Return a Model object.
:param str key: If None, return all cross-validated models; otherwise return the model
specified by the key.
:returns: A model or a list of models.
"""
return {model.model_id: model.get_xval_mode... | def get_xval_models(self, key=None):
"""
Return a Model object.
:param str key: If None, return all cross-validated models; otherwise return the model
specified by the key.
:returns: A model or a list of models.
"""
return {model.model_id: model.get_xval_mode... | [
"Return",
"a",
"Model",
"object",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/grid/grid_search.py#L342-L350 | [
"def",
"get_xval_models",
"(",
"self",
",",
"key",
"=",
"None",
")",
":",
"return",
"{",
"model",
".",
"model_id",
":",
"model",
".",
"get_xval_models",
"(",
"key",
")",
"for",
"model",
"in",
"self",
".",
"models",
"}"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OGridSearch.deepfeatures | Obtain a hidden layer's details on a dataset.
:param test_data: Data to create a feature space on.
:param int layer: Index of the hidden layer.
:returns: A dictionary of hidden layer details for each model. | h2o-py/h2o/grid/grid_search.py | def deepfeatures(self, test_data, layer):
"""
Obtain a hidden layer's details on a dataset.
:param test_data: Data to create a feature space on.
:param int layer: Index of the hidden layer.
:returns: A dictionary of hidden layer details for each model.
"""
return... | def deepfeatures(self, test_data, layer):
"""
Obtain a hidden layer's details on a dataset.
:param test_data: Data to create a feature space on.
:param int layer: Index of the hidden layer.
:returns: A dictionary of hidden layer details for each model.
"""
return... | [
"Obtain",
"a",
"hidden",
"layer",
"s",
"details",
"on",
"a",
"dataset",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/grid/grid_search.py#L358-L366 | [
"def",
"deepfeatures",
"(",
"self",
",",
"test_data",
",",
"layer",
")",
":",
"return",
"{",
"model",
".",
"model_id",
":",
"model",
".",
"deepfeatures",
"(",
"test_data",
",",
"layer",
")",
"for",
"model",
"in",
"self",
".",
"models",
"}"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OGridSearch.weights | Return the frame for the respective weight matrix.
:param: matrix_id: an integer, ranging from 0 to number of layers, that specifies the weight matrix to return.
:returns: an H2OFrame which represents the weight matrix identified by matrix_id | h2o-py/h2o/grid/grid_search.py | def weights(self, matrix_id=0):
"""
Return the frame for the respective weight matrix.
:param: matrix_id: an integer, ranging from 0 to number of layers, that specifies the weight matrix to return.
:returns: an H2OFrame which represents the weight matrix identified by matrix_id
... | def weights(self, matrix_id=0):
"""
Return the frame for the respective weight matrix.
:param: matrix_id: an integer, ranging from 0 to number of layers, that specifies the weight matrix to return.
:returns: an H2OFrame which represents the weight matrix identified by matrix_id
... | [
"Return",
"the",
"frame",
"for",
"the",
"respective",
"weight",
"matrix",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/grid/grid_search.py#L369-L376 | [
"def",
"weights",
"(",
"self",
",",
"matrix_id",
"=",
"0",
")",
":",
"return",
"{",
"model",
".",
"model_id",
":",
"model",
".",
"weights",
"(",
"matrix_id",
")",
"for",
"model",
"in",
"self",
".",
"models",
"}"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OGridSearch.biases | Return the frame for the respective bias vector.
:param: vector_id: an integer, ranging from 0 to number of layers, that specifies the bias vector to return.
:returns: an H2OFrame which represents the bias vector identified by vector_id | h2o-py/h2o/grid/grid_search.py | def biases(self, vector_id=0):
"""
Return the frame for the respective bias vector.
:param: vector_id: an integer, ranging from 0 to number of layers, that specifies the bias vector to return.
:returns: an H2OFrame which represents the bias vector identified by vector_id
"""
... | def biases(self, vector_id=0):
"""
Return the frame for the respective bias vector.
:param: vector_id: an integer, ranging from 0 to number of layers, that specifies the bias vector to return.
:returns: an H2OFrame which represents the bias vector identified by vector_id
"""
... | [
"Return",
"the",
"frame",
"for",
"the",
"respective",
"bias",
"vector",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/grid/grid_search.py#L379-L386 | [
"def",
"biases",
"(",
"self",
",",
"vector_id",
"=",
"0",
")",
":",
"return",
"{",
"model",
".",
"model_id",
":",
"model",
".",
"biases",
"(",
"vector_id",
")",
"for",
"model",
"in",
"self",
".",
"models",
"}"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OGridSearch.model_performance | Generate model metrics for this model on test_data.
:param test_data: Data set for which model metrics shall be computed against. All three of train, valid
and xval arguments are ignored if test_data is not None.
:param train: Report the training metrics for the model.
:param valid:... | h2o-py/h2o/grid/grid_search.py | def model_performance(self, test_data=None, train=False, valid=False, xval=False):
"""
Generate model metrics for this model on test_data.
:param test_data: Data set for which model metrics shall be computed against. All three of train, valid
and xval arguments are ignored if test_d... | def model_performance(self, test_data=None, train=False, valid=False, xval=False):
"""
Generate model metrics for this model on test_data.
:param test_data: Data set for which model metrics shall be computed against. All three of train, valid
and xval arguments are ignored if test_d... | [
"Generate",
"model",
"metrics",
"for",
"this",
"model",
"on",
"test_data",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/grid/grid_search.py#L416-L427 | [
"def",
"model_performance",
"(",
"self",
",",
"test_data",
"=",
"None",
",",
"train",
"=",
"False",
",",
"valid",
"=",
"False",
",",
"xval",
"=",
"False",
")",
":",
"return",
"{",
"model",
".",
"model_id",
":",
"model",
".",
"model_performance",
"(",
"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OGridSearch.summary | Print a detailed summary of the explored models. | h2o-py/h2o/grid/grid_search.py | def summary(self, header=True):
"""Print a detailed summary of the explored models."""
table = []
for model in self.models:
model_summary = model._model_json["output"]["model_summary"]
r_values = list(model_summary.cell_values[0])
r_values[0] = model.model_id
... | def summary(self, header=True):
"""Print a detailed summary of the explored models."""
table = []
for model in self.models:
model_summary = model._model_json["output"]["model_summary"]
r_values = list(model_summary.cell_values[0])
r_values[0] = model.model_id
... | [
"Print",
"a",
"detailed",
"summary",
"of",
"the",
"explored",
"models",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/grid/grid_search.py#L439-L457 | [
"def",
"summary",
"(",
"self",
",",
"header",
"=",
"True",
")",
":",
"table",
"=",
"[",
"]",
"for",
"model",
"in",
"self",
".",
"models",
":",
"model_summary",
"=",
"model",
".",
"_model_json",
"[",
"\"output\"",
"]",
"[",
"\"model_summary\"",
"]",
"r_... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OGridSearch.show | Print models sorted by metric. | h2o-py/h2o/grid/grid_search.py | def show(self):
"""Print models sorted by metric."""
hyper_combos = itertools.product(*list(self.hyper_params.values()))
if not self.models:
c_values = [[idx + 1, list(val)] for idx, val in enumerate(hyper_combos)]
print(H2OTwoDimTable(
col_header=['Model'... | def show(self):
"""Print models sorted by metric."""
hyper_combos = itertools.product(*list(self.hyper_params.values()))
if not self.models:
c_values = [[idx + 1, list(val)] for idx, val in enumerate(hyper_combos)]
print(H2OTwoDimTable(
col_header=['Model'... | [
"Print",
"models",
"sorted",
"by",
"metric",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/grid/grid_search.py#L460-L469 | [
"def",
"show",
"(",
"self",
")",
":",
"hyper_combos",
"=",
"itertools",
".",
"product",
"(",
"*",
"list",
"(",
"self",
".",
"hyper_params",
".",
"values",
"(",
")",
")",
")",
"if",
"not",
"self",
".",
"models",
":",
"c_values",
"=",
"[",
"[",
"idx"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OGridSearch.varimp | Pretty print the variable importances, or return them in a list/pandas DataFrame.
:param bool use_pandas: If True, then the variable importances will be returned as a pandas data frame.
:returns: A dictionary of lists or Pandas DataFrame instances. | h2o-py/h2o/grid/grid_search.py | def varimp(self, use_pandas=False):
"""
Pretty print the variable importances, or return them in a list/pandas DataFrame.
:param bool use_pandas: If True, then the variable importances will be returned as a pandas data frame.
:returns: A dictionary of lists or Pandas DataFrame instance... | def varimp(self, use_pandas=False):
"""
Pretty print the variable importances, or return them in a list/pandas DataFrame.
:param bool use_pandas: If True, then the variable importances will be returned as a pandas data frame.
:returns: A dictionary of lists or Pandas DataFrame instance... | [
"Pretty",
"print",
"the",
"variable",
"importances",
"or",
"return",
"them",
"in",
"a",
"list",
"/",
"pandas",
"DataFrame",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/grid/grid_search.py#L472-L480 | [
"def",
"varimp",
"(",
"self",
",",
"use_pandas",
"=",
"False",
")",
":",
"return",
"{",
"model",
".",
"model_id",
":",
"model",
".",
"varimp",
"(",
"use_pandas",
")",
"for",
"model",
"in",
"self",
".",
"models",
"}"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OGridSearch.pprint_coef | Pretty print the coefficents table (includes normalized coefficients). | h2o-py/h2o/grid/grid_search.py | def pprint_coef(self):
"""Pretty print the coefficents table (includes normalized coefficients)."""
for i, model in enumerate(self.models):
print('Model', i)
model.pprint_coef()
print() | def pprint_coef(self):
"""Pretty print the coefficents table (includes normalized coefficients)."""
for i, model in enumerate(self.models):
print('Model', i)
model.pprint_coef()
print() | [
"Pretty",
"print",
"the",
"coefficents",
"table",
"(",
"includes",
"normalized",
"coefficients",
")",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/grid/grid_search.py#L543-L548 | [
"def",
"pprint_coef",
"(",
"self",
")",
":",
"for",
"i",
",",
"model",
"in",
"enumerate",
"(",
"self",
".",
"models",
")",
":",
"print",
"(",
"'Model'",
",",
"i",
")",
"model",
".",
"pprint_coef",
"(",
")",
"print",
"(",
")"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OGridSearch.get_hyperparams | Get the hyperparameters of a model explored by grid search.
:param str id: The model id of the model with hyperparameters of interest.
:param bool display: Flag to indicate whether to display the hyperparameter names.
:returns: A list of the hyperparameters for the specified model. | h2o-py/h2o/grid/grid_search.py | def get_hyperparams(self, id, display=True):
"""
Get the hyperparameters of a model explored by grid search.
:param str id: The model id of the model with hyperparameters of interest.
:param bool display: Flag to indicate whether to display the hyperparameter names.
:returns: A... | def get_hyperparams(self, id, display=True):
"""
Get the hyperparameters of a model explored by grid search.
:param str id: The model id of the model with hyperparameters of interest.
:param bool display: Flag to indicate whether to display the hyperparameter names.
:returns: A... | [
"Get",
"the",
"hyperparameters",
"of",
"a",
"model",
"explored",
"by",
"grid",
"search",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/grid/grid_search.py#L686-L707 | [
"def",
"get_hyperparams",
"(",
"self",
",",
"id",
",",
"display",
"=",
"True",
")",
":",
"idx",
"=",
"id",
"if",
"is_type",
"(",
"id",
",",
"int",
")",
"else",
"self",
".",
"model_ids",
".",
"index",
"(",
"id",
")",
"model",
"=",
"self",
"[",
"id... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OGridSearch.get_hyperparams_dict | Derived and returned the model parameters used to train the particular grid search model.
:param str id: The model id of the model with hyperparameters of interest.
:param bool display: Flag to indicate whether to display the hyperparameter names.
:returns: A dict of model pararmeters derived ... | h2o-py/h2o/grid/grid_search.py | def get_hyperparams_dict(self, id, display=True):
"""
Derived and returned the model parameters used to train the particular grid search model.
:param str id: The model id of the model with hyperparameters of interest.
:param bool display: Flag to indicate whether to display the hyperpa... | def get_hyperparams_dict(self, id, display=True):
"""
Derived and returned the model parameters used to train the particular grid search model.
:param str id: The model id of the model with hyperparameters of interest.
:param bool display: Flag to indicate whether to display the hyperpa... | [
"Derived",
"and",
"returned",
"the",
"model",
"parameters",
"used",
"to",
"train",
"the",
"particular",
"grid",
"search",
"model",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/grid/grid_search.py#L710-L734 | [
"def",
"get_hyperparams_dict",
"(",
"self",
",",
"id",
",",
"display",
"=",
"True",
")",
":",
"idx",
"=",
"id",
"if",
"is_type",
"(",
"id",
",",
"int",
")",
"else",
"self",
".",
"model_ids",
".",
"index",
"(",
"id",
")",
"model",
"=",
"self",
"[",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OGridSearch.get_grid | Retrieve an H2OGridSearch instance.
Optionally specify a metric by which to sort models and a sort order.
Note that if neither cross-validation nor a validation frame is used in the grid search, then the
training metrics will display in the "get grid" output. If a validation frame is passed to ... | h2o-py/h2o/grid/grid_search.py | def get_grid(self, sort_by=None, decreasing=None):
"""
Retrieve an H2OGridSearch instance.
Optionally specify a metric by which to sort models and a sort order.
Note that if neither cross-validation nor a validation frame is used in the grid search, then the
training metrics wil... | def get_grid(self, sort_by=None, decreasing=None):
"""
Retrieve an H2OGridSearch instance.
Optionally specify a metric by which to sort models and a sort order.
Note that if neither cross-validation nor a validation frame is used in the grid search, then the
training metrics wil... | [
"Retrieve",
"an",
"H2OGridSearch",
"instance",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/grid/grid_search.py#L770-L802 | [
"def",
"get_grid",
"(",
"self",
",",
"sort_by",
"=",
"None",
",",
"decreasing",
"=",
"None",
")",
":",
"if",
"sort_by",
"is",
"None",
"and",
"decreasing",
"is",
"None",
":",
"return",
"self",
"grid_json",
"=",
"h2o",
".",
"api",
"(",
"\"GET /99/Grids/%s\... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.