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 | H2OWord2vecEstimator.from_external | Creates new H2OWord2vecEstimator based on an external model.
:param external: H2OFrame with an external model
:return: H2OWord2vecEstimator instance representing the external model | h2o-py/h2o/estimators/word2vec.py | def from_external(external=H2OFrame):
"""
Creates new H2OWord2vecEstimator based on an external model.
:param external: H2OFrame with an external model
:return: H2OWord2vecEstimator instance representing the external model
"""
w2v_model = H2OWord2vecEstimator(pre_trained=... | def from_external(external=H2OFrame):
"""
Creates new H2OWord2vecEstimator based on an external model.
:param external: H2OFrame with an external model
:return: H2OWord2vecEstimator instance representing the external model
"""
w2v_model = H2OWord2vecEstimator(pre_trained=... | [
"Creates",
"new",
"H2OWord2vecEstimator",
"based",
"on",
"an",
"external",
"model",
".",
":",
"param",
"external",
":",
"H2OFrame",
"with",
"an",
"external",
"model",
":",
"return",
":",
"H2OWord2vecEstimator",
"instance",
"representing",
"the",
"external",
"model... | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/estimators/word2vec.py#L234-L242 | [
"def",
"from_external",
"(",
"external",
"=",
"H2OFrame",
")",
":",
"w2v_model",
"=",
"H2OWord2vecEstimator",
"(",
"pre_trained",
"=",
"external",
")",
"w2v_model",
".",
"train",
"(",
")",
"return",
"w2v_model"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OWord2vecEstimator._determine_vec_size | Determines vec_size for a pre-trained model after basic model verification. | h2o-py/h2o/estimators/word2vec.py | def _determine_vec_size(self):
"""
Determines vec_size for a pre-trained model after basic model verification.
"""
first_column = self.pre_trained.types[self.pre_trained.columns[0]]
if first_column != 'string':
raise H2OValueError("First column of given pre_trained m... | def _determine_vec_size(self):
"""
Determines vec_size for a pre-trained model after basic model verification.
"""
first_column = self.pre_trained.types[self.pre_trained.columns[0]]
if first_column != 'string':
raise H2OValueError("First column of given pre_trained m... | [
"Determines",
"vec_size",
"for",
"a",
"pre",
"-",
"trained",
"model",
"after",
"basic",
"model",
"verification",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/estimators/word2vec.py#L244-L258 | [
"def",
"_determine_vec_size",
"(",
"self",
")",
":",
"first_column",
"=",
"self",
".",
"pre_trained",
".",
"types",
"[",
"self",
".",
"pre_trained",
".",
"columns",
"[",
"0",
"]",
"]",
"if",
"first_column",
"!=",
"'string'",
":",
"raise",
"H2OValueError",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | h2o_mean_absolute_error | Mean absolute error regression loss.
:param y_actual: H2OFrame of actual response.
:param y_predicted: H2OFrame of predicted response.
:param weights: (Optional) sample weights
:returns: mean absolute error loss (best is 0.0). | h2o-py/h2o/model/regression.py | def h2o_mean_absolute_error(y_actual, y_predicted, weights=None):
"""
Mean absolute error regression loss.
:param y_actual: H2OFrame of actual response.
:param y_predicted: H2OFrame of predicted response.
:param weights: (Optional) sample weights
:returns: mean absolute error loss (best is 0.0)... | def h2o_mean_absolute_error(y_actual, y_predicted, weights=None):
"""
Mean absolute error regression loss.
:param y_actual: H2OFrame of actual response.
:param y_predicted: H2OFrame of predicted response.
:param weights: (Optional) sample weights
:returns: mean absolute error loss (best is 0.0)... | [
"Mean",
"absolute",
"error",
"regression",
"loss",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/regression.py#L43-L53 | [
"def",
"h2o_mean_absolute_error",
"(",
"y_actual",
",",
"y_predicted",
",",
"weights",
"=",
"None",
")",
":",
"ModelBase",
".",
"_check_targets",
"(",
"y_actual",
",",
"y_predicted",
")",
"return",
"_colmean",
"(",
"(",
"y_predicted",
"-",
"y_actual",
")",
"."... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | h2o_mean_squared_error | Mean squared error regression loss
:param y_actual: H2OFrame of actual response.
:param y_predicted: H2OFrame of predicted response.
:param weights: (Optional) sample weights
:returns: mean squared error loss (best is 0.0). | h2o-py/h2o/model/regression.py | def h2o_mean_squared_error(y_actual, y_predicted, weights=None):
"""
Mean squared error regression loss
:param y_actual: H2OFrame of actual response.
:param y_predicted: H2OFrame of predicted response.
:param weights: (Optional) sample weights
:returns: mean squared error loss (best is 0.0).
... | def h2o_mean_squared_error(y_actual, y_predicted, weights=None):
"""
Mean squared error regression loss
:param y_actual: H2OFrame of actual response.
:param y_predicted: H2OFrame of predicted response.
:param weights: (Optional) sample weights
:returns: mean squared error loss (best is 0.0).
... | [
"Mean",
"squared",
"error",
"regression",
"loss"
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/regression.py#L56-L66 | [
"def",
"h2o_mean_squared_error",
"(",
"y_actual",
",",
"y_predicted",
",",
"weights",
"=",
"None",
")",
":",
"ModelBase",
".",
"_check_targets",
"(",
"y_actual",
",",
"y_predicted",
")",
"return",
"_colmean",
"(",
"(",
"y_predicted",
"-",
"y_actual",
")",
"**"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | h2o_median_absolute_error | Median absolute error regression loss
:param y_actual: H2OFrame of actual response.
:param y_predicted: H2OFrame of predicted response.
:returns: median absolute error loss (best is 0.0) | h2o-py/h2o/model/regression.py | def h2o_median_absolute_error(y_actual, y_predicted):
"""
Median absolute error regression loss
:param y_actual: H2OFrame of actual response.
:param y_predicted: H2OFrame of predicted response.
:returns: median absolute error loss (best is 0.0)
"""
ModelBase._check_targets(y_actual, y_predi... | def h2o_median_absolute_error(y_actual, y_predicted):
"""
Median absolute error regression loss
:param y_actual: H2OFrame of actual response.
:param y_predicted: H2OFrame of predicted response.
:returns: median absolute error loss (best is 0.0)
"""
ModelBase._check_targets(y_actual, y_predi... | [
"Median",
"absolute",
"error",
"regression",
"loss"
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/regression.py#L69-L78 | [
"def",
"h2o_median_absolute_error",
"(",
"y_actual",
",",
"y_predicted",
")",
":",
"ModelBase",
".",
"_check_targets",
"(",
"y_actual",
",",
"y_predicted",
")",
"return",
"(",
"y_predicted",
"-",
"y_actual",
")",
".",
"abs",
"(",
")",
".",
"median",
"(",
")"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | h2o_explained_variance_score | Explained variance regression score function.
:param y_actual: H2OFrame of actual response.
:param y_predicted: H2OFrame of predicted response.
:param weights: (Optional) sample weights
:returns: the explained variance score. | h2o-py/h2o/model/regression.py | def h2o_explained_variance_score(y_actual, y_predicted, weights=None):
"""
Explained variance regression score function.
:param y_actual: H2OFrame of actual response.
:param y_predicted: H2OFrame of predicted response.
:param weights: (Optional) sample weights
:returns: the explained variance s... | def h2o_explained_variance_score(y_actual, y_predicted, weights=None):
"""
Explained variance regression score function.
:param y_actual: H2OFrame of actual response.
:param y_predicted: H2OFrame of predicted response.
:param weights: (Optional) sample weights
:returns: the explained variance s... | [
"Explained",
"variance",
"regression",
"score",
"function",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/regression.py#L81-L96 | [
"def",
"h2o_explained_variance_score",
"(",
"y_actual",
",",
"y_predicted",
",",
"weights",
"=",
"None",
")",
":",
"ModelBase",
".",
"_check_targets",
"(",
"y_actual",
",",
"y_predicted",
")",
"_",
",",
"numerator",
"=",
"_mean_var",
"(",
"y_actual",
"-",
"y_p... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | h2o_r2_score | R-squared (coefficient of determination) regression score function
:param y_actual: H2OFrame of actual response.
:param y_predicted: H2OFrame of predicted response.
:param weights: (Optional) sample weights
:returns: R-squared (best is 1.0, lower is worse). | h2o-py/h2o/model/regression.py | def h2o_r2_score(y_actual, y_predicted, weights=1.):
"""
R-squared (coefficient of determination) regression score function
:param y_actual: H2OFrame of actual response.
:param y_predicted: H2OFrame of predicted response.
:param weights: (Optional) sample weights
:returns: R-squared (best is 1.... | def h2o_r2_score(y_actual, y_predicted, weights=1.):
"""
R-squared (coefficient of determination) regression score function
:param y_actual: H2OFrame of actual response.
:param y_predicted: H2OFrame of predicted response.
:param weights: (Optional) sample weights
:returns: R-squared (best is 1.... | [
"R",
"-",
"squared",
"(",
"coefficient",
"of",
"determination",
")",
"regression",
"score",
"function"
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/regression.py#L99-L114 | [
"def",
"h2o_r2_score",
"(",
"y_actual",
",",
"y_predicted",
",",
"weights",
"=",
"1.",
")",
":",
"ModelBase",
".",
"_check_targets",
"(",
"y_actual",
",",
"y_predicted",
")",
"numerator",
"=",
"(",
"weights",
"*",
"(",
"y_actual",
"-",
"y_predicted",
")",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2ORegressionModel.plot | Plots training set (and validation set if available) scoring history for an H2ORegressionModel. The timestep
and metric arguments are restricted to what is available in its scoring history.
:param timestep: A unit of measurement for the x-axis.
:param metric: A unit of measurement for the y-axi... | h2o-py/h2o/model/regression.py | def plot(self, timestep="AUTO", metric="AUTO", **kwargs):
"""
Plots training set (and validation set if available) scoring history for an H2ORegressionModel. The timestep
and metric arguments are restricted to what is available in its scoring history.
:param timestep: A unit of measurem... | def plot(self, timestep="AUTO", metric="AUTO", **kwargs):
"""
Plots training set (and validation set if available) scoring history for an H2ORegressionModel. The timestep
and metric arguments are restricted to what is available in its scoring history.
:param timestep: A unit of measurem... | [
"Plots",
"training",
"set",
"(",
"and",
"validation",
"set",
"if",
"available",
")",
"scoring",
"history",
"for",
"an",
"H2ORegressionModel",
".",
"The",
"timestep",
"and",
"metric",
"arguments",
"are",
"restricted",
"to",
"what",
"is",
"available",
"in",
"its... | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/regression.py#L13-L29 | [
"def",
"plot",
"(",
"self",
",",
"timestep",
"=",
"\"AUTO\"",
",",
"metric",
"=",
"\"AUTO\"",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"_model_json",
"[",
"\"algo\"",
"]",
"in",
"(",
"\"deeplearning\"",
",",
"\"deepwater\"",
",",
"\"xgboost\... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | assert_is_type | Assert that the argument has the specified type.
This function is used to check that the type of the argument is correct, otherwises it raises an H2OTypeError.
See more details in the module's help.
:param var: variable to check
:param types: the expected types
:param kwargs:
message: over... | h2o-py/h2o/utils/typechecks.py | def assert_is_type(var, *types, **kwargs):
"""
Assert that the argument has the specified type.
This function is used to check that the type of the argument is correct, otherwises it raises an H2OTypeError.
See more details in the module's help.
:param var: variable to check
:param types: the ... | def assert_is_type(var, *types, **kwargs):
"""
Assert that the argument has the specified type.
This function is used to check that the type of the argument is correct, otherwises it raises an H2OTypeError.
See more details in the module's help.
:param var: variable to check
:param types: the ... | [
"Assert",
"that",
"the",
"argument",
"has",
"the",
"specified",
"type",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/typechecks.py#L429-L457 | [
"def",
"assert_is_type",
"(",
"var",
",",
"*",
"types",
",",
"*",
"*",
"kwargs",
")",
":",
"assert",
"types",
",",
"\"The list of expected types was not provided\"",
"expected_type",
"=",
"types",
"[",
"0",
"]",
"if",
"len",
"(",
"types",
")",
"==",
"1",
"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | assert_matches | Assert that string variable matches the provided regular expression.
:param v: variable to check.
:param regex: regular expression to check against (can be either a string, or compiled regexp). | h2o-py/h2o/utils/typechecks.py | def assert_matches(v, regex):
"""
Assert that string variable matches the provided regular expression.
:param v: variable to check.
:param regex: regular expression to check against (can be either a string, or compiled regexp).
"""
m = re.match(regex, v)
if m is None:
vn = _retrieve... | def assert_matches(v, regex):
"""
Assert that string variable matches the provided regular expression.
:param v: variable to check.
:param regex: regular expression to check against (can be either a string, or compiled regexp).
"""
m = re.match(regex, v)
if m is None:
vn = _retrieve... | [
"Assert",
"that",
"string",
"variable",
"matches",
"the",
"provided",
"regular",
"expression",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/typechecks.py#L461-L473 | [
"def",
"assert_matches",
"(",
"v",
",",
"regex",
")",
":",
"m",
"=",
"re",
".",
"match",
"(",
"regex",
",",
"v",
")",
"if",
"m",
"is",
"None",
":",
"vn",
"=",
"_retrieve_assert_arguments",
"(",
")",
"[",
"0",
"]",
"message",
"=",
"\"Argument `{var}` ... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | assert_satisfies | Assert that variable satisfies the provided condition.
:param v: variable to check. Its value is only used for error reporting.
:param bool cond: condition that must be satisfied. Should be somehow related to the variable ``v``.
:param message: message string to use instead of the default. | h2o-py/h2o/utils/typechecks.py | def assert_satisfies(v, cond, message=None):
"""
Assert that variable satisfies the provided condition.
:param v: variable to check. Its value is only used for error reporting.
:param bool cond: condition that must be satisfied. Should be somehow related to the variable ``v``.
:param message: messa... | def assert_satisfies(v, cond, message=None):
"""
Assert that variable satisfies the provided condition.
:param v: variable to check. Its value is only used for error reporting.
:param bool cond: condition that must be satisfied. Should be somehow related to the variable ``v``.
:param message: messa... | [
"Assert",
"that",
"variable",
"satisfies",
"the",
"provided",
"condition",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/typechecks.py#L476-L489 | [
"def",
"assert_satisfies",
"(",
"v",
",",
"cond",
",",
"message",
"=",
"None",
")",
":",
"if",
"not",
"cond",
":",
"vname",
",",
"vexpr",
"=",
"_retrieve_assert_arguments",
"(",
")",
"if",
"not",
"message",
":",
"message",
"=",
"\"Argument `{var}` (= {val!r}... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | _retrieve_assert_arguments | Magic variable name retrieval.
This function is designed as a helper for assert_is_type() function. Typically such assertion is used like this::
assert_is_type(num_threads, int)
If the variable `num_threads` turns out to be non-integer, we would like to raise an exception such as
H2OTypeErro... | h2o-py/h2o/utils/typechecks.py | def _retrieve_assert_arguments():
"""
Magic variable name retrieval.
This function is designed as a helper for assert_is_type() function. Typically such assertion is used like this::
assert_is_type(num_threads, int)
If the variable `num_threads` turns out to be non-integer, we would like to r... | def _retrieve_assert_arguments():
"""
Magic variable name retrieval.
This function is designed as a helper for assert_is_type() function. Typically such assertion is used like this::
assert_is_type(num_threads, int)
If the variable `num_threads` turns out to be non-integer, we would like to r... | [
"Magic",
"variable",
"name",
"retrieval",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/typechecks.py#L497-L560 | [
"def",
"_retrieve_assert_arguments",
"(",
")",
":",
"try",
":",
"raise",
"RuntimeError",
"(",
"\"Catch me!\"",
")",
"except",
"RuntimeError",
":",
"# Walk up the stacktrace until we are outside of this file",
"tb",
"=",
"sys",
".",
"exc_info",
"(",
")",
"[",
"2",
"]... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | _check_type | Return True if the variable is of the specified type, and False otherwise.
:param var: variable to check
:param vtype: expected variable's type | h2o-py/h2o/utils/typechecks.py | def _check_type(var, vtype):
"""
Return True if the variable is of the specified type, and False otherwise.
:param var: variable to check
:param vtype: expected variable's type
"""
if vtype is None:
return var is None
if isinstance(vtype, _primitive_type):
return var == vtyp... | def _check_type(var, vtype):
"""
Return True if the variable is of the specified type, and False otherwise.
:param var: variable to check
:param vtype: expected variable's type
"""
if vtype is None:
return var is None
if isinstance(vtype, _primitive_type):
return var == vtyp... | [
"Return",
"True",
"if",
"the",
"variable",
"is",
"of",
"the",
"specified",
"type",
"and",
"False",
"otherwise",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/typechecks.py#L563-L603 | [
"def",
"_check_type",
"(",
"var",
",",
"vtype",
")",
":",
"if",
"vtype",
"is",
"None",
":",
"return",
"var",
"is",
"None",
"if",
"isinstance",
"(",
"vtype",
",",
"_primitive_type",
")",
":",
"return",
"var",
"==",
"vtype",
"if",
"vtype",
"is",
"str",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | _get_type_name | Return the name of the provided type.
_get_type_name(int) == "integer"
_get_type_name(str) == "string"
_get_type_name(tuple) == "tuple"
_get_type_name(Exception) == "Exception"
_get_type_name(U(int, float, bool)) == "integer|float|bool"
_get_type_name(U(H2OFrame, None)) ... | h2o-py/h2o/utils/typechecks.py | def _get_type_name(vtype, dump=None):
"""
Return the name of the provided type.
_get_type_name(int) == "integer"
_get_type_name(str) == "string"
_get_type_name(tuple) == "tuple"
_get_type_name(Exception) == "Exception"
_get_type_name(U(int, float, bool)) == "integer|floa... | def _get_type_name(vtype, dump=None):
"""
Return the name of the provided type.
_get_type_name(int) == "integer"
_get_type_name(str) == "string"
_get_type_name(tuple) == "tuple"
_get_type_name(Exception) == "Exception"
_get_type_name(U(int, float, bool)) == "integer|floa... | [
"Return",
"the",
"name",
"of",
"the",
"provided",
"type",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/typechecks.py#L606-L647 | [
"def",
"_get_type_name",
"(",
"vtype",
",",
"dump",
"=",
"None",
")",
":",
"if",
"vtype",
"is",
"None",
":",
"return",
"\"None\"",
"if",
"vtype",
"is",
"str",
":",
"return",
"\"string\"",
"if",
"vtype",
"is",
"int",
":",
"return",
"\"integer\"",
"if",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | _get_lambda_source_code | Attempt to find the source code of the ``lambda_fn`` within the string ``src``. | h2o-py/h2o/utils/typechecks.py | def _get_lambda_source_code(lambda_fn, src):
"""Attempt to find the source code of the ``lambda_fn`` within the string ``src``."""
def gen_lambdas():
def gen():
yield src + "\n"
g = gen()
step = 0
tokens = []
for tok in tokenize.generate_tokens(getattr(g, "ne... | def _get_lambda_source_code(lambda_fn, src):
"""Attempt to find the source code of the ``lambda_fn`` within the string ``src``."""
def gen_lambdas():
def gen():
yield src + "\n"
g = gen()
step = 0
tokens = []
for tok in tokenize.generate_tokens(getattr(g, "ne... | [
"Attempt",
"to",
"find",
"the",
"source",
"code",
"of",
"the",
"lambda_fn",
"within",
"the",
"string",
"src",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/typechecks.py#L650-L696 | [
"def",
"_get_lambda_source_code",
"(",
"lambda_fn",
",",
"src",
")",
":",
"def",
"gen_lambdas",
"(",
")",
":",
"def",
"gen",
"(",
")",
":",
"yield",
"src",
"+",
"\"\\n\"",
"g",
"=",
"gen",
"(",
")",
"step",
"=",
"0",
"tokens",
"=",
"[",
"]",
"for",... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | U.name | Return string representing the name of this type. | h2o-py/h2o/utils/typechecks.py | def name(self, src=None):
"""Return string representing the name of this type."""
res = [_get_type_name(tt, src) for tt in self._types]
if len(res) == 2 and "None" in res:
res.remove("None")
return "?" + res[0]
else:
return " | ".join(res) | def name(self, src=None):
"""Return string representing the name of this type."""
res = [_get_type_name(tt, src) for tt in self._types]
if len(res) == 2 and "None" in res:
res.remove("None")
return "?" + res[0]
else:
return " | ".join(res) | [
"Return",
"string",
"representing",
"the",
"name",
"of",
"this",
"type",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/typechecks.py#L181-L188 | [
"def",
"name",
"(",
"self",
",",
"src",
"=",
"None",
")",
":",
"res",
"=",
"[",
"_get_type_name",
"(",
"tt",
",",
"src",
")",
"for",
"tt",
"in",
"self",
".",
"_types",
"]",
"if",
"len",
"(",
"res",
")",
"==",
"2",
"and",
"\"None\"",
"in",
"res"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | I.check | Return True if the variable matches this type, and False otherwise. | h2o-py/h2o/utils/typechecks.py | def check(self, var):
"""Return True if the variable matches this type, and False otherwise."""
return all(_check_type(var, tt) for tt in self._types) | def check(self, var):
"""Return True if the variable matches this type, and False otherwise."""
return all(_check_type(var, tt) for tt in self._types) | [
"Return",
"True",
"if",
"the",
"variable",
"matches",
"this",
"type",
"and",
"False",
"otherwise",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/typechecks.py#L205-L207 | [
"def",
"check",
"(",
"self",
",",
"var",
")",
":",
"return",
"all",
"(",
"_check_type",
"(",
"var",
",",
"tt",
")",
"for",
"tt",
"in",
"self",
".",
"_types",
")"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | I.name | Return string representing the name of this type. | h2o-py/h2o/utils/typechecks.py | def name(self, src=None):
"""Return string representing the name of this type."""
return " & ".join(_get_type_name(tt, src) for tt in self._types) | def name(self, src=None):
"""Return string representing the name of this type."""
return " & ".join(_get_type_name(tt, src) for tt in self._types) | [
"Return",
"string",
"representing",
"the",
"name",
"of",
"this",
"type",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/typechecks.py#L209-L211 | [
"def",
"name",
"(",
"self",
",",
"src",
"=",
"None",
")",
":",
"return",
"\" & \"",
".",
"join",
"(",
"_get_type_name",
"(",
"tt",
",",
"src",
")",
"for",
"tt",
"in",
"self",
".",
"_types",
")"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | NOT.check | Return True if the variable does not match any of the types, and False otherwise. | h2o-py/h2o/utils/typechecks.py | def check(self, var):
"""Return True if the variable does not match any of the types, and False otherwise."""
return not any(_check_type(var, tt) for tt in self._types) | def check(self, var):
"""Return True if the variable does not match any of the types, and False otherwise."""
return not any(_check_type(var, tt) for tt in self._types) | [
"Return",
"True",
"if",
"the",
"variable",
"does",
"not",
"match",
"any",
"of",
"the",
"types",
"and",
"False",
"otherwise",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/typechecks.py#L226-L228 | [
"def",
"check",
"(",
"self",
",",
"var",
")",
":",
"return",
"not",
"any",
"(",
"_check_type",
"(",
"var",
",",
"tt",
")",
"for",
"tt",
"in",
"self",
".",
"_types",
")"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | NOT.name | Return string representing the name of this type. | h2o-py/h2o/utils/typechecks.py | def name(self, src=None):
"""Return string representing the name of this type."""
if len(self._types) > 1:
return "!(%s)" % str("|".join(_get_type_name(tt, src) for tt in self._types))
else:
return "!" + _get_type_name(self._types[0], src) | def name(self, src=None):
"""Return string representing the name of this type."""
if len(self._types) > 1:
return "!(%s)" % str("|".join(_get_type_name(tt, src) for tt in self._types))
else:
return "!" + _get_type_name(self._types[0], src) | [
"Return",
"string",
"representing",
"the",
"name",
"of",
"this",
"type",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/typechecks.py#L230-L235 | [
"def",
"name",
"(",
"self",
",",
"src",
"=",
"None",
")",
":",
"if",
"len",
"(",
"self",
".",
"_types",
")",
">",
"1",
":",
"return",
"\"!(%s)\"",
"%",
"str",
"(",
"\"|\"",
".",
"join",
"(",
"_get_type_name",
"(",
"tt",
",",
"src",
")",
"for",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | Tuple.check | Return True if the variable matches this type, and False otherwise. | h2o-py/h2o/utils/typechecks.py | def check(self, var):
"""Return True if the variable matches this type, and False otherwise."""
return isinstance(var, tuple) and all(_check_type(t, self._element_type) for t in var) | def check(self, var):
"""Return True if the variable matches this type, and False otherwise."""
return isinstance(var, tuple) and all(_check_type(t, self._element_type) for t in var) | [
"Return",
"True",
"if",
"the",
"variable",
"matches",
"this",
"type",
"and",
"False",
"otherwise",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/typechecks.py#L246-L248 | [
"def",
"check",
"(",
"self",
",",
"var",
")",
":",
"return",
"isinstance",
"(",
"var",
",",
"tuple",
")",
"and",
"all",
"(",
"_check_type",
"(",
"t",
",",
"self",
".",
"_element_type",
")",
"for",
"t",
"in",
"var",
")"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | Dict.check | Return True if the variable matches this type, and False otherwise. | h2o-py/h2o/utils/typechecks.py | def check(self, var):
"""Return True if the variable matches this type, and False otherwise."""
if not isinstance(var, dict): return False
if any(key not in self._types for key in var): return False
for key, ktype in viewitems(self._types):
val = var.get(key, None)
... | def check(self, var):
"""Return True if the variable matches this type, and False otherwise."""
if not isinstance(var, dict): return False
if any(key not in self._types for key in var): return False
for key, ktype in viewitems(self._types):
val = var.get(key, None)
... | [
"Return",
"True",
"if",
"the",
"variable",
"matches",
"this",
"type",
"and",
"False",
"otherwise",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/typechecks.py#L273-L281 | [
"def",
"check",
"(",
"self",
",",
"var",
")",
":",
"if",
"not",
"isinstance",
"(",
"var",
",",
"dict",
")",
":",
"return",
"False",
"if",
"any",
"(",
"key",
"not",
"in",
"self",
".",
"_types",
"for",
"key",
"in",
"var",
")",
":",
"return",
"False... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | Dict.name | Return string representing the name of this type. | h2o-py/h2o/utils/typechecks.py | def name(self, src=None):
"""Return string representing the name of this type."""
return "{%s}" % ", ".join("%s: %s" % (key, _get_type_name(ktype, src))
for key, ktype in viewitems(self._types)) | def name(self, src=None):
"""Return string representing the name of this type."""
return "{%s}" % ", ".join("%s: %s" % (key, _get_type_name(ktype, src))
for key, ktype in viewitems(self._types)) | [
"Return",
"string",
"representing",
"the",
"name",
"of",
"this",
"type",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/typechecks.py#L283-L286 | [
"def",
"name",
"(",
"self",
",",
"src",
"=",
"None",
")",
":",
"return",
"\"{%s}\"",
"%",
"\", \"",
".",
"join",
"(",
"\"%s: %s\"",
"%",
"(",
"key",
",",
"_get_type_name",
"(",
"ktype",
",",
"src",
")",
")",
"for",
"key",
",",
"ktype",
"in",
"viewi... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | BoundInt.check | Return True if the variable matches the specified type. | h2o-py/h2o/utils/typechecks.py | def check(self, var):
"""Return True if the variable matches the specified type."""
return (isinstance(var, _int_type) and
(self._lower_bound is None or var >= self._lower_bound) and
(self._upper_bound is None or var <= self._upper_bound)) | def check(self, var):
"""Return True if the variable matches the specified type."""
return (isinstance(var, _int_type) and
(self._lower_bound is None or var >= self._lower_bound) and
(self._upper_bound is None or var <= self._upper_bound)) | [
"Return",
"True",
"if",
"the",
"variable",
"matches",
"the",
"specified",
"type",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/typechecks.py#L306-L310 | [
"def",
"check",
"(",
"self",
",",
"var",
")",
":",
"return",
"(",
"isinstance",
"(",
"var",
",",
"_int_type",
")",
"and",
"(",
"self",
".",
"_lower_bound",
"is",
"None",
"or",
"var",
">=",
"self",
".",
"_lower_bound",
")",
"and",
"(",
"self",
".",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | BoundInt.name | Return string representing the name of this type. | h2o-py/h2o/utils/typechecks.py | def name(self, src=None):
"""Return string representing the name of this type."""
if self._upper_bound is None and self._lower_bound is None: return "int"
if self._upper_bound is None:
if self._lower_bound == 1: return "int>0"
return "int≥%d" % self._lower_bound
i... | def name(self, src=None):
"""Return string representing the name of this type."""
if self._upper_bound is None and self._lower_bound is None: return "int"
if self._upper_bound is None:
if self._lower_bound == 1: return "int>0"
return "int≥%d" % self._lower_bound
i... | [
"Return",
"string",
"representing",
"the",
"name",
"of",
"this",
"type",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/typechecks.py#L312-L320 | [
"def",
"name",
"(",
"self",
",",
"src",
"=",
"None",
")",
":",
"if",
"self",
".",
"_upper_bound",
"is",
"None",
"and",
"self",
".",
"_lower_bound",
"is",
"None",
":",
"return",
"\"int\"",
"if",
"self",
".",
"_upper_bound",
"is",
"None",
":",
"if",
"s... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | BoundNumeric.check | Return True if the variable matches the specified type. | h2o-py/h2o/utils/typechecks.py | def check(self, var):
"""Return True if the variable matches the specified type."""
return (isinstance(var, _num_type) and
(self._lower_bound is None or var >= self._lower_bound) and
(self._upper_bound is None or var <= self._upper_bound)) | def check(self, var):
"""Return True if the variable matches the specified type."""
return (isinstance(var, _num_type) and
(self._lower_bound is None or var >= self._lower_bound) and
(self._upper_bound is None or var <= self._upper_bound)) | [
"Return",
"True",
"if",
"the",
"variable",
"matches",
"the",
"specified",
"type",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/typechecks.py#L336-L340 | [
"def",
"check",
"(",
"self",
",",
"var",
")",
":",
"return",
"(",
"isinstance",
"(",
"var",
",",
"_num_type",
")",
"and",
"(",
"self",
".",
"_lower_bound",
"is",
"None",
"or",
"var",
">=",
"self",
".",
"_lower_bound",
")",
"and",
"(",
"self",
".",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | _LazyClass.check | Return True if the variable matches this type, and False otherwise. | h2o-py/h2o/utils/typechecks.py | def check(self, var):
"""Return True if the variable matches this type, and False otherwise."""
if self._class is None: self._init()
return self._class and self._checker(var, self._class) | def check(self, var):
"""Return True if the variable matches this type, and False otherwise."""
if self._class is None: self._init()
return self._class and self._checker(var, self._class) | [
"Return",
"True",
"if",
"the",
"variable",
"matches",
"this",
"type",
"and",
"False",
"otherwise",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/typechecks.py#L373-L376 | [
"def",
"check",
"(",
"self",
",",
"var",
")",
":",
"if",
"self",
".",
"_class",
"is",
"None",
":",
"self",
".",
"_init",
"(",
")",
"return",
"self",
".",
"_class",
"and",
"self",
".",
"_checker",
"(",
"var",
",",
"self",
".",
"_class",
")"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | Enum.check | Check whether the provided value is a valid enum constant. | h2o-py/h2o/utils/typechecks.py | def check(self, var):
"""Check whether the provided value is a valid enum constant."""
if not isinstance(var, _str_type): return False
return _enum_mangle(var) in self._consts | def check(self, var):
"""Check whether the provided value is a valid enum constant."""
if not isinstance(var, _str_type): return False
return _enum_mangle(var) in self._consts | [
"Check",
"whether",
"the",
"provided",
"value",
"is",
"a",
"valid",
"enum",
"constant",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/typechecks.py#L403-L406 | [
"def",
"check",
"(",
"self",
",",
"var",
")",
":",
"if",
"not",
"isinstance",
"(",
"var",
",",
"_str_type",
")",
":",
"return",
"False",
"return",
"_enum_mangle",
"(",
"var",
")",
"in",
"self",
".",
"_consts"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OConfigReader.get_config | Retrieve the config as a dictionary of key-value pairs. | h2o-py/h2o/utils/config.py | def get_config():
"""Retrieve the config as a dictionary of key-value pairs."""
self = H2OConfigReader._get_instance()
if not self._config_loaded:
self._read_config()
return self._config | def get_config():
"""Retrieve the config as a dictionary of key-value pairs."""
self = H2OConfigReader._get_instance()
if not self._config_loaded:
self._read_config()
return self._config | [
"Retrieve",
"the",
"config",
"as",
"a",
"dictionary",
"of",
"key",
"-",
"value",
"pairs",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/config.py#L24-L29 | [
"def",
"get_config",
"(",
")",
":",
"self",
"=",
"H2OConfigReader",
".",
"_get_instance",
"(",
")",
"if",
"not",
"self",
".",
"_config_loaded",
":",
"self",
".",
"_read_config",
"(",
")",
"return",
"self",
".",
"_config"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OConfigReader._read_config | Find and parse config file, storing all variables in ``self._config``. | h2o-py/h2o/utils/config.py | def _read_config(self):
"""Find and parse config file, storing all variables in ``self._config``."""
self._config_loaded = True
conf = []
for f in self._candidate_log_files():
if os.path.isfile(f):
self._logger.info("Reading config file %s" % f)
... | def _read_config(self):
"""Find and parse config file, storing all variables in ``self._config``."""
self._config_loaded = True
conf = []
for f in self._candidate_log_files():
if os.path.isfile(f):
self._logger.info("Reading config file %s" % f)
... | [
"Find",
"and",
"parse",
"config",
"file",
"storing",
"all",
"variables",
"in",
"self",
".",
"_config",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/config.py#L56-L89 | [
"def",
"_read_config",
"(",
"self",
")",
":",
"self",
".",
"_config_loaded",
"=",
"True",
"conf",
"=",
"[",
"]",
"for",
"f",
"in",
"self",
".",
"_candidate_log_files",
"(",
")",
":",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"f",
")",
":",
"self... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OConfigReader._candidate_log_files | Return possible locations for the .h2oconfig file, one at a time. | h2o-py/h2o/utils/config.py | def _candidate_log_files():
"""Return possible locations for the .h2oconfig file, one at a time."""
# Search for .h2oconfig in the current directory and all parent directories
relpath = ".h2oconfig"
prevpath = None
while True:
abspath = os.path.abspath(relpath)
... | def _candidate_log_files():
"""Return possible locations for the .h2oconfig file, one at a time."""
# Search for .h2oconfig in the current directory and all parent directories
relpath = ".h2oconfig"
prevpath = None
while True:
abspath = os.path.abspath(relpath)
... | [
"Return",
"possible",
"locations",
"for",
"the",
".",
"h2oconfig",
"file",
"one",
"at",
"a",
"time",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/config.py#L92-L104 | [
"def",
"_candidate_log_files",
"(",
")",
":",
"# Search for .h2oconfig in the current directory and all parent directories",
"relpath",
"=",
"\".h2oconfig\"",
"prevpath",
"=",
"None",
"while",
"True",
":",
"abspath",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"relpath... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | ProgressBar.execute | Start the progress bar, and return only when the progress reaches 100%.
:param progress_fn: the executor function (or a generator). This function should take no arguments
and return either a single number -- the current progress level, or a tuple (progress level, delay),
where delay is ... | h2o-py/h2o/utils/progressbar.py | def execute(self, progress_fn, print_verbose_info=None):
"""
Start the progress bar, and return only when the progress reaches 100%.
:param progress_fn: the executor function (or a generator). This function should take no arguments
and return either a single number -- the current pr... | def execute(self, progress_fn, print_verbose_info=None):
"""
Start the progress bar, and return only when the progress reaches 100%.
:param progress_fn: the executor function (or a generator). This function should take no arguments
and return either a single number -- the current pr... | [
"Start",
"the",
"progress",
"bar",
"and",
"return",
"only",
"when",
"the",
"progress",
"reaches",
"100%",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/progressbar.py#L134-L210 | [
"def",
"execute",
"(",
"self",
",",
"progress_fn",
",",
"print_verbose_info",
"=",
"None",
")",
":",
"assert_is_type",
"(",
"progress_fn",
",",
"FunctionType",
",",
"GeneratorType",
",",
"MethodType",
")",
"if",
"isinstance",
"(",
"progress_fn",
",",
"GeneratorT... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | ProgressBar._store_model_progress | Save the current model progress into ``self._progress_data``, and update ``self._next_poll_time``.
:param res: tuple (progress level, poll delay).
:param now: current timestamp. | h2o-py/h2o/utils/progressbar.py | def _store_model_progress(self, res, now):
"""
Save the current model progress into ``self._progress_data``, and update ``self._next_poll_time``.
:param res: tuple (progress level, poll delay).
:param now: current timestamp.
"""
raw_progress, delay = res
raw_prog... | def _store_model_progress(self, res, now):
"""
Save the current model progress into ``self._progress_data``, and update ``self._next_poll_time``.
:param res: tuple (progress level, poll delay).
:param now: current timestamp.
"""
raw_progress, delay = res
raw_prog... | [
"Save",
"the",
"current",
"model",
"progress",
"into",
"self",
".",
"_progress_data",
"and",
"update",
"self",
".",
"_next_poll_time",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/progressbar.py#L220-L235 | [
"def",
"_store_model_progress",
"(",
"self",
",",
"res",
",",
"now",
")",
":",
"raw_progress",
",",
"delay",
"=",
"res",
"raw_progress",
"=",
"clamp",
"(",
"raw_progress",
",",
"0",
",",
"self",
".",
"_maxval",
")",
"self",
".",
"_progress_data",
".",
"a... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | ProgressBar._recalculate_model_parameters | Compute t0, x0, v0, ve. | h2o-py/h2o/utils/progressbar.py | def _recalculate_model_parameters(self, now):
"""Compute t0, x0, v0, ve."""
time_until_end = self._estimate_progress_completion_time(now) - now
assert time_until_end >= 0, "Estimated progress completion cannot be in the past."
x_real = self._get_real_progress()
if x_real == 1:
... | def _recalculate_model_parameters(self, now):
"""Compute t0, x0, v0, ve."""
time_until_end = self._estimate_progress_completion_time(now) - now
assert time_until_end >= 0, "Estimated progress completion cannot be in the past."
x_real = self._get_real_progress()
if x_real == 1:
... | [
"Compute",
"t0",
"x0",
"v0",
"ve",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/progressbar.py#L238-L266 | [
"def",
"_recalculate_model_parameters",
"(",
"self",
",",
"now",
")",
":",
"time_until_end",
"=",
"self",
".",
"_estimate_progress_completion_time",
"(",
"now",
")",
"-",
"now",
"assert",
"time_until_end",
">=",
"0",
",",
"\"Estimated progress completion cannot be in th... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | ProgressBar._estimate_progress_completion_time | Estimate the moment when the underlying process is expected to reach completion.
This function should only return future times. Also this function is not allowed to return time moments less
than self._next_poll_time if the actual progress is below 100% (this is because we won't know that the
pr... | h2o-py/h2o/utils/progressbar.py | def _estimate_progress_completion_time(self, now):
"""
Estimate the moment when the underlying process is expected to reach completion.
This function should only return future times. Also this function is not allowed to return time moments less
than self._next_poll_time if the actual pr... | def _estimate_progress_completion_time(self, now):
"""
Estimate the moment when the underlying process is expected to reach completion.
This function should only return future times. Also this function is not allowed to return time moments less
than self._next_poll_time if the actual pr... | [
"Estimate",
"the",
"moment",
"when",
"the",
"underlying",
"process",
"is",
"expected",
"to",
"reach",
"completion",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/progressbar.py#L269-L303 | [
"def",
"_estimate_progress_completion_time",
"(",
"self",
",",
"now",
")",
":",
"assert",
"self",
".",
"_next_poll_time",
">=",
"now",
"tlast",
",",
"wlast",
"=",
"self",
".",
"_progress_data",
"[",
"-",
"1",
"]",
"# If reached 100%, make sure that we finish as soon... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | ProgressBar._guess_next_poll_interval | Determine when to query the progress status next.
This function is used if the external progress function did not return time interval for when it should be
queried next. | h2o-py/h2o/utils/progressbar.py | def _guess_next_poll_interval(self):
"""
Determine when to query the progress status next.
This function is used if the external progress function did not return time interval for when it should be
queried next.
"""
time_elapsed = self._progress_data[-1][0] - self._progr... | def _guess_next_poll_interval(self):
"""
Determine when to query the progress status next.
This function is used if the external progress function did not return time interval for when it should be
queried next.
"""
time_elapsed = self._progress_data[-1][0] - self._progr... | [
"Determine",
"when",
"to",
"query",
"the",
"progress",
"status",
"next",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/progressbar.py#L306-L315 | [
"def",
"_guess_next_poll_interval",
"(",
"self",
")",
":",
"time_elapsed",
"=",
"self",
".",
"_progress_data",
"[",
"-",
"1",
"]",
"[",
"0",
"]",
"-",
"self",
".",
"_progress_data",
"[",
"0",
"]",
"[",
"0",
"]",
"real_progress",
"=",
"self",
".",
"_get... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | ProgressBar._compute_progress_at_time | Calculate the modelled progress state for the given time moment.
:returns: tuple (x, v) of the progress level and progress speed. | h2o-py/h2o/utils/progressbar.py | def _compute_progress_at_time(self, t):
"""
Calculate the modelled progress state for the given time moment.
:returns: tuple (x, v) of the progress level and progress speed.
"""
t0, x0, v0, ve = self._t0, self._x0, self._v0, self._ve
z = (v0 - ve) * math.exp(-self.BETA *... | def _compute_progress_at_time(self, t):
"""
Calculate the modelled progress state for the given time moment.
:returns: tuple (x, v) of the progress level and progress speed.
"""
t0, x0, v0, ve = self._t0, self._x0, self._v0, self._ve
z = (v0 - ve) * math.exp(-self.BETA *... | [
"Calculate",
"the",
"modelled",
"progress",
"state",
"for",
"the",
"given",
"time",
"moment",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/progressbar.py#L318-L328 | [
"def",
"_compute_progress_at_time",
"(",
"self",
",",
"t",
")",
":",
"t0",
",",
"x0",
",",
"v0",
",",
"ve",
"=",
"self",
".",
"_t0",
",",
"self",
".",
"_x0",
",",
"self",
".",
"_v0",
",",
"self",
".",
"_ve",
"z",
"=",
"(",
"v0",
"-",
"ve",
")... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | ProgressBar._get_time_at_progress | Return the projected time when progress level `x_target` will be reached.
Since the underlying progress model is nonlinear, we need to do use Newton method to find a numerical solution
to the equation x(t) = x_target. | h2o-py/h2o/utils/progressbar.py | def _get_time_at_progress(self, x_target):
"""
Return the projected time when progress level `x_target` will be reached.
Since the underlying progress model is nonlinear, we need to do use Newton method to find a numerical solution
to the equation x(t) = x_target.
"""
t,... | def _get_time_at_progress(self, x_target):
"""
Return the projected time when progress level `x_target` will be reached.
Since the underlying progress model is nonlinear, we need to do use Newton method to find a numerical solution
to the equation x(t) = x_target.
"""
t,... | [
"Return",
"the",
"projected",
"time",
"when",
"progress",
"level",
"x_target",
"will",
"be",
"reached",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/progressbar.py#L331-L349 | [
"def",
"_get_time_at_progress",
"(",
"self",
",",
"x_target",
")",
":",
"t",
",",
"x",
",",
"v",
"=",
"self",
".",
"_t0",
",",
"self",
".",
"_x0",
",",
"self",
".",
"_v0",
"# The convergence should be achieved in just few iterations, however in unlikely situation th... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | ProgressBar._draw | Print the rendered string to the stdout. | h2o-py/h2o/utils/progressbar.py | def _draw(self, txt, final=False):
"""Print the rendered string to the stdout."""
if not self._file_mode:
# If the user presses Ctrl+C this ensures we still start writing from the beginning of the line
sys.stdout.write("\r")
sys.stdout.write(txt)
if final and not ... | def _draw(self, txt, final=False):
"""Print the rendered string to the stdout."""
if not self._file_mode:
# If the user presses Ctrl+C this ensures we still start writing from the beginning of the line
sys.stdout.write("\r")
sys.stdout.write(txt)
if final and not ... | [
"Print",
"the",
"rendered",
"string",
"to",
"the",
"stdout",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/progressbar.py#L352-L363 | [
"def",
"_draw",
"(",
"self",
",",
"txt",
",",
"final",
"=",
"False",
")",
":",
"if",
"not",
"self",
".",
"_file_mode",
":",
"# If the user presses Ctrl+C this ensures we still start writing from the beginning of the line",
"sys",
".",
"stdout",
".",
"write",
"(",
"\... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | _ProgressBarCompoundWidget.render | Render the widget. | h2o-py/h2o/utils/progressbar.py | def render(self, progress, width=None, status=None):
"""Render the widget."""
results = [widget.render(progress, width=self._widget_lengths[i], status=status)
for i, widget in enumerate(self._widgets)]
if self._file_mode:
res = ""
for i, result in enum... | def render(self, progress, width=None, status=None):
"""Render the widget."""
results = [widget.render(progress, width=self._widget_lengths[i], status=status)
for i, widget in enumerate(self._widgets)]
if self._file_mode:
res = ""
for i, result in enum... | [
"Render",
"the",
"widget",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/progressbar.py#L504-L524 | [
"def",
"render",
"(",
"self",
",",
"progress",
",",
"width",
"=",
"None",
",",
"status",
"=",
"None",
")",
":",
"results",
"=",
"[",
"widget",
".",
"render",
"(",
"progress",
",",
"width",
"=",
"self",
".",
"_widget_lengths",
"[",
"i",
"]",
",",
"s... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | _ProgressBarCompoundWidget._compute_widget_sizes | Initial rendering stage, done in order to compute widths of all widgets. | h2o-py/h2o/utils/progressbar.py | def _compute_widget_sizes(self):
"""Initial rendering stage, done in order to compute widths of all widgets."""
wl = [0] * len(self._widgets)
flex_count = 0
# First render all non-flexible widgets
for i, widget in enumerate(self._widgets):
if isinstance(widget, Progr... | def _compute_widget_sizes(self):
"""Initial rendering stage, done in order to compute widths of all widgets."""
wl = [0] * len(self._widgets)
flex_count = 0
# First render all non-flexible widgets
for i, widget in enumerate(self._widgets):
if isinstance(widget, Progr... | [
"Initial",
"rendering",
"stage",
"done",
"in",
"order",
"to",
"compute",
"widths",
"of",
"all",
"widgets",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/progressbar.py#L527-L568 | [
"def",
"_compute_widget_sizes",
"(",
"self",
")",
":",
"wl",
"=",
"[",
"0",
"]",
"*",
"len",
"(",
"self",
".",
"_widgets",
")",
"flex_count",
"=",
"0",
"# First render all non-flexible widgets",
"for",
"i",
",",
"widget",
"in",
"enumerate",
"(",
"self",
".... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | _ProgressBarCompoundWidget._get_terminal_size | Find current STDOUT's width, in characters. | h2o-py/h2o/utils/progressbar.py | def _get_terminal_size():
"""Find current STDOUT's width, in characters."""
# If output is not terminal but a regular file, assume 100 chars width
if not sys.stdout.isatty():
return 80
# Otherwise, first try getting the dimensions from shell command `stty`:
try:
... | def _get_terminal_size():
"""Find current STDOUT's width, in characters."""
# If output is not terminal but a regular file, assume 100 chars width
if not sys.stdout.isatty():
return 80
# Otherwise, first try getting the dimensions from shell command `stty`:
try:
... | [
"Find",
"current",
"STDOUT",
"s",
"width",
"in",
"characters",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/progressbar.py#L572-L598 | [
"def",
"_get_terminal_size",
"(",
")",
":",
"# If output is not terminal but a regular file, assume 100 chars width",
"if",
"not",
"sys",
".",
"stdout",
".",
"isatty",
"(",
")",
":",
"return",
"80",
"# Otherwise, first try getting the dimensions from shell command `stty`:",
"tr... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | PBWBar.render | Render the widget. | h2o-py/h2o/utils/progressbar.py | def render(self, progress, width=None, status=None):
"""Render the widget."""
if width <= 3: return RenderResult()
bar_width = width - 2 # Total width minus the bar ends
n_chars = int(progress * bar_width + 0.001)
endf, endl = self._bar_ends
if self._file_mode:
... | def render(self, progress, width=None, status=None):
"""Render the widget."""
if width <= 3: return RenderResult()
bar_width = width - 2 # Total width minus the bar ends
n_chars = int(progress * bar_width + 0.001)
endf, endl = self._bar_ends
if self._file_mode:
... | [
"Render",
"the",
"widget",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/progressbar.py#L637-L665 | [
"def",
"render",
"(",
"self",
",",
"progress",
",",
"width",
"=",
"None",
",",
"status",
"=",
"None",
")",
":",
"if",
"width",
"<=",
"3",
":",
"return",
"RenderResult",
"(",
")",
"bar_width",
"=",
"width",
"-",
"2",
"# Total width minus the bar ends",
"n... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | PBWBar.set_encoding | Inform the widget about the encoding of the underlying character stream. | h2o-py/h2o/utils/progressbar.py | def set_encoding(self, encoding):
"""Inform the widget about the encoding of the underlying character stream."""
self._bar_ends = "[]"
self._bar_symbols = "#"
if not encoding: return
s1 = "\u258F\u258E\u258D\u258C\u258B\u258A\u2589\u2588"
s2 = "\u258C\u2588"
s3 = ... | def set_encoding(self, encoding):
"""Inform the widget about the encoding of the underlying character stream."""
self._bar_ends = "[]"
self._bar_symbols = "#"
if not encoding: return
s1 = "\u258F\u258E\u258D\u258C\u258B\u258A\u2589\u2588"
s2 = "\u258C\u2588"
s3 = ... | [
"Inform",
"the",
"widget",
"about",
"the",
"encoding",
"of",
"the",
"underlying",
"character",
"stream",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/progressbar.py#L667-L688 | [
"def",
"set_encoding",
"(",
"self",
",",
"encoding",
")",
":",
"self",
".",
"_bar_ends",
"=",
"\"[]\"",
"self",
".",
"_bar_symbols",
"=",
"\"#\"",
"if",
"not",
"encoding",
":",
"return",
"s1",
"=",
"\"\\u258F\\u258E\\u258D\\u258C\\u258B\\u258A\\u2589\\u2588\"",
"s... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | PBWPercentage.render | Render the widget. | h2o-py/h2o/utils/progressbar.py | def render(self, progress, width=None, status=None):
"""Render the widget."""
current_pct = int(progress * 100 + 0.1)
return RenderResult(rendered="%3d%%" % current_pct, next_progress=(current_pct + 1) / 100) | def render(self, progress, width=None, status=None):
"""Render the widget."""
current_pct = int(progress * 100 + 0.1)
return RenderResult(rendered="%3d%%" % current_pct, next_progress=(current_pct + 1) / 100) | [
"Render",
"the",
"widget",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/utils/progressbar.py#L700-L703 | [
"def",
"render",
"(",
"self",
",",
"progress",
",",
"width",
"=",
"None",
",",
"status",
"=",
"None",
")",
":",
"current_pct",
"=",
"int",
"(",
"progress",
"*",
"100",
"+",
"0.1",
")",
"return",
"RenderResult",
"(",
"rendered",
"=",
"\"%3d%%\"",
"%",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | genDataFrame | This function will generate an H2OFrame of two columns. One column will be float and the other will
be long.
:param sizeMat: integer denoting size of bounds
:param lowBound: lower bound
:param uppderBound:
:param trueRandom:
:param numRep: number of times to repeat arrays in order to gen... | scripts/gen_numerical_data.py | def genDataFrame(sizeMat, lowBound, uppderBound, numRep, numZeros, numNans, numInfs):
'''
This function will generate an H2OFrame of two columns. One column will be float and the other will
be long.
:param sizeMat: integer denoting size of bounds
:param lowBound: lower bound
:param uppderB... | def genDataFrame(sizeMat, lowBound, uppderBound, numRep, numZeros, numNans, numInfs):
'''
This function will generate an H2OFrame of two columns. One column will be float and the other will
be long.
:param sizeMat: integer denoting size of bounds
:param lowBound: lower bound
:param uppderB... | [
"This",
"function",
"will",
"generate",
"an",
"H2OFrame",
"of",
"two",
"columns",
".",
"One",
"column",
"will",
"be",
"float",
"and",
"the",
"other",
"will",
"be",
"long",
".",
":",
"param",
"sizeMat",
":",
"integer",
"denoting",
"size",
"of",
"bounds",
... | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/gen_numerical_data.py#L75-L123 | [
"def",
"genDataFrame",
"(",
"sizeMat",
",",
"lowBound",
",",
"uppderBound",
",",
"numRep",
",",
"numZeros",
",",
"numNans",
",",
"numInfs",
")",
":",
"if",
"(",
"numNans",
">",
"0",
")",
":",
"floatA",
"=",
"[",
"float",
"(",
"'NaN'",
")",
"]",
"*",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | TargetEncoder.fit | Returns encoding map as an object that maps 'column_name' -> 'frame_with_encoding_map_for_this_column_name'
:param frame frame: An H2OFrame object with which to create the target encoding map | h2o-py/h2o/targetencoder.py | def fit(self, frame = None):
"""
Returns encoding map as an object that maps 'column_name' -> 'frame_with_encoding_map_for_this_column_name'
:param frame frame: An H2OFrame object with which to create the target encoding map
"""
self._teColumns = list(map(lambda i: frame.names[i... | def fit(self, frame = None):
"""
Returns encoding map as an object that maps 'column_name' -> 'frame_with_encoding_map_for_this_column_name'
:param frame frame: An H2OFrame object with which to create the target encoding map
"""
self._teColumns = list(map(lambda i: frame.names[i... | [
"Returns",
"encoding",
"map",
"as",
"an",
"object",
"that",
"maps",
"column_name",
"-",
">",
"frame_with_encoding_map_for_this_column_name"
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/targetencoder.py#L78-L91 | [
"def",
"fit",
"(",
"self",
",",
"frame",
"=",
"None",
")",
":",
"self",
".",
"_teColumns",
"=",
"list",
"(",
"map",
"(",
"lambda",
"i",
":",
"frame",
".",
"names",
"[",
"i",
"]",
",",
"self",
".",
"_teColumns",
")",
")",
"if",
"all",
"(",
"isin... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | TargetEncoder.transform | Apply transformation to `te_columns` based on the encoding maps generated during `TargetEncoder.fit()` call.
You must not pass encodings manually from `.fit()` method because they are being stored internally
after `.fit()' had been called.
:param frame frame: to which frame we are applying targ... | h2o-py/h2o/targetencoder.py | def transform(self, frame=None, holdout_type=None, noise=-1, seed=-1):
"""
Apply transformation to `te_columns` based on the encoding maps generated during `TargetEncoder.fit()` call.
You must not pass encodings manually from `.fit()` method because they are being stored internally
after... | def transform(self, frame=None, holdout_type=None, noise=-1, seed=-1):
"""
Apply transformation to `te_columns` based on the encoding maps generated during `TargetEncoder.fit()` call.
You must not pass encodings manually from `.fit()` method because they are being stored internally
after... | [
"Apply",
"transformation",
"to",
"te_columns",
"based",
"on",
"the",
"encoding",
"maps",
"generated",
"during",
"TargetEncoder",
".",
"fit",
"()",
"call",
".",
"You",
"must",
"not",
"pass",
"encodings",
"manually",
"from",
".",
"fit",
"()",
"method",
"because"... | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/targetencoder.py#L93-L118 | [
"def",
"transform",
"(",
"self",
",",
"frame",
"=",
"None",
",",
"holdout_type",
"=",
"None",
",",
"noise",
"=",
"-",
"1",
",",
"seed",
"=",
"-",
"1",
")",
":",
"assert_is_type",
"(",
"holdout_type",
",",
"\"kfold\"",
",",
"\"loo\"",
",",
"\"none\"",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | generatePandaEnumCols | For an H2O Enum column, we perform one-hot-encoding here and add one more column, "missing(NA)" to it.
:param pandaFtrain: panda frame derived from H2OFrame
:param cname: column name of enum col
:param nrows: number of rows of enum col
:return: panda frame with enum col encoded correctly for native XGB... | h2o-py/h2o/frame.py | def generatePandaEnumCols(pandaFtrain, cname, nrows, domainL):
"""
For an H2O Enum column, we perform one-hot-encoding here and add one more column, "missing(NA)" to it.
:param pandaFtrain: panda frame derived from H2OFrame
:param cname: column name of enum col
:param nrows: number of rows of enum ... | def generatePandaEnumCols(pandaFtrain, cname, nrows, domainL):
"""
For an H2O Enum column, we perform one-hot-encoding here and add one more column, "missing(NA)" to it.
:param pandaFtrain: panda frame derived from H2OFrame
:param cname: column name of enum col
:param nrows: number of rows of enum ... | [
"For",
"an",
"H2O",
"Enum",
"column",
"we",
"perform",
"one",
"-",
"hot",
"-",
"encoding",
"here",
"and",
"add",
"one",
"more",
"column",
"missing",
"(",
"NA",
")",
"to",
"it",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L3445-L3478 | [
"def",
"generatePandaEnumCols",
"(",
"pandaFtrain",
",",
"cname",
",",
"nrows",
",",
"domainL",
")",
":",
"import",
"numpy",
"as",
"np",
"import",
"pandas",
"as",
"pd",
"cmissingNames",
"=",
"[",
"cname",
"+",
"\".missing(NA)\"",
"]",
"tempnp",
"=",
"np",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.get_frame | Retrieve an existing H2OFrame from the H2O cluster using the frame's id.
:param str frame_id: id of the frame to retrieve
:param int rows: number of rows to fetch for preview (10 by default)
:param int rows_offset: offset to fetch rows from (0 by default)
:param int cols: number of colu... | h2o-py/h2o/frame.py | def get_frame(frame_id, rows=10, rows_offset=0, cols=-1, full_cols=-1, cols_offset=0, light=False):
"""
Retrieve an existing H2OFrame from the H2O cluster using the frame's id.
:param str frame_id: id of the frame to retrieve
:param int rows: number of rows to fetch for preview (10 by d... | def get_frame(frame_id, rows=10, rows_offset=0, cols=-1, full_cols=-1, cols_offset=0, light=False):
"""
Retrieve an existing H2OFrame from the H2O cluster using the frame's id.
:param str frame_id: id of the frame to retrieve
:param int rows: number of rows to fetch for preview (10 by d... | [
"Retrieve",
"an",
"existing",
"H2OFrame",
"from",
"the",
"H2O",
"cluster",
"using",
"the",
"frame",
"s",
"id",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L194-L213 | [
"def",
"get_frame",
"(",
"frame_id",
",",
"rows",
"=",
"10",
",",
"rows_offset",
"=",
"0",
",",
"cols",
"=",
"-",
"1",
",",
"full_cols",
"=",
"-",
"1",
",",
"cols_offset",
"=",
"0",
",",
"light",
"=",
"False",
")",
":",
"fr",
"=",
"H2OFrame",
"("... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.refresh | Reload frame information from the backend H2O server. | h2o-py/h2o/frame.py | def refresh(self):
"""Reload frame information from the backend H2O server."""
self._ex._cache.flush()
self._frame(fill_cache=True) | def refresh(self):
"""Reload frame information from the backend H2O server."""
self._ex._cache.flush()
self._frame(fill_cache=True) | [
"Reload",
"frame",
"information",
"from",
"the",
"backend",
"H2O",
"server",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L216-L219 | [
"def",
"refresh",
"(",
"self",
")",
":",
"self",
".",
"_ex",
".",
"_cache",
".",
"flush",
"(",
")",
"self",
".",
"_frame",
"(",
"fill_cache",
"=",
"True",
")"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.names | The list of column names (List[str]). | h2o-py/h2o/frame.py | def names(self):
"""The list of column names (List[str])."""
if not self._ex._cache.names_valid():
self._ex._cache.flush()
self._frame(fill_cache=True)
return list(self._ex._cache.names) | def names(self):
"""The list of column names (List[str])."""
if not self._ex._cache.names_valid():
self._ex._cache.flush()
self._frame(fill_cache=True)
return list(self._ex._cache.names) | [
"The",
"list",
"of",
"column",
"names",
"(",
"List",
"[",
"str",
"]",
")",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L228-L233 | [
"def",
"names",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_ex",
".",
"_cache",
".",
"names_valid",
"(",
")",
":",
"self",
".",
"_ex",
".",
"_cache",
".",
"flush",
"(",
")",
"self",
".",
"_frame",
"(",
"fill_cache",
"=",
"True",
")",
"retu... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.nrows | Number of rows in the dataframe (int). | h2o-py/h2o/frame.py | def nrows(self):
"""Number of rows in the dataframe (int)."""
if not self._ex._cache.nrows_valid():
self._ex._cache.flush()
self._frame(fill_cache=True)
return self._ex._cache.nrows | def nrows(self):
"""Number of rows in the dataframe (int)."""
if not self._ex._cache.nrows_valid():
self._ex._cache.flush()
self._frame(fill_cache=True)
return self._ex._cache.nrows | [
"Number",
"of",
"rows",
"in",
"the",
"dataframe",
"(",
"int",
")",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L241-L246 | [
"def",
"nrows",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_ex",
".",
"_cache",
".",
"nrows_valid",
"(",
")",
":",
"self",
".",
"_ex",
".",
"_cache",
".",
"flush",
"(",
")",
"self",
".",
"_frame",
"(",
"fill_cache",
"=",
"True",
")",
"retu... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.ncols | Number of columns in the dataframe (int). | h2o-py/h2o/frame.py | def ncols(self):
"""Number of columns in the dataframe (int)."""
if not self._ex._cache.ncols_valid():
self._ex._cache.flush()
self._frame(fill_cache=True)
return self._ex._cache.ncols | def ncols(self):
"""Number of columns in the dataframe (int)."""
if not self._ex._cache.ncols_valid():
self._ex._cache.flush()
self._frame(fill_cache=True)
return self._ex._cache.ncols | [
"Number",
"of",
"columns",
"in",
"the",
"dataframe",
"(",
"int",
")",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L250-L255 | [
"def",
"ncols",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_ex",
".",
"_cache",
".",
"ncols_valid",
"(",
")",
":",
"self",
".",
"_ex",
".",
"_cache",
".",
"flush",
"(",
")",
"self",
".",
"_frame",
"(",
"fill_cache",
"=",
"True",
")",
"retu... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.types | The dictionary of column name/type pairs. | h2o-py/h2o/frame.py | def types(self):
"""The dictionary of column name/type pairs."""
if not self._ex._cache.types_valid():
self._ex._cache.flush()
self._frame(fill_cache=True)
return dict(self._ex._cache.types) | def types(self):
"""The dictionary of column name/type pairs."""
if not self._ex._cache.types_valid():
self._ex._cache.flush()
self._frame(fill_cache=True)
return dict(self._ex._cache.types) | [
"The",
"dictionary",
"of",
"column",
"name",
"/",
"type",
"pairs",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L265-L270 | [
"def",
"types",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_ex",
".",
"_cache",
".",
"types_valid",
"(",
")",
":",
"self",
".",
"_ex",
".",
"_cache",
".",
"flush",
"(",
")",
"self",
".",
"_frame",
"(",
"fill_cache",
"=",
"True",
")",
"retu... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.type | The type for the given column.
:param col: either a name, or an index of the column to look up
:returns: type of the column, one of: ``str``, ``int``, ``real``, ``enum``, ``time``, ``bool``.
:raises H2OValueError: if such column does not exist in the frame. | h2o-py/h2o/frame.py | def type(self, col):
"""
The type for the given column.
:param col: either a name, or an index of the column to look up
:returns: type of the column, one of: ``str``, ``int``, ``real``, ``enum``, ``time``, ``bool``.
:raises H2OValueError: if such column does not exist in the fra... | def type(self, col):
"""
The type for the given column.
:param col: either a name, or an index of the column to look up
:returns: type of the column, one of: ``str``, ``int``, ``real``, ``enum``, ``time``, ``bool``.
:raises H2OValueError: if such column does not exist in the fra... | [
"The",
"type",
"for",
"the",
"given",
"column",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L289-L309 | [
"def",
"type",
"(",
"self",
",",
"col",
")",
":",
"assert_is_type",
"(",
"col",
",",
"int",
",",
"str",
")",
"if",
"not",
"self",
".",
"_ex",
".",
"_cache",
".",
"types_valid",
"(",
")",
"or",
"not",
"self",
".",
"_ex",
".",
"_cache",
".",
"names... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.columns_by_type | Extract columns of the specified type from the frame.
:param str coltype: A character string indicating which column type to filter by. This must be
one of the following:
- ``"numeric"`` - Numeric, but not categorical or time
- ``"categorical"`` - Integer, with a cate... | h2o-py/h2o/frame.py | def columns_by_type(self, coltype="numeric"):
"""
Extract columns of the specified type from the frame.
:param str coltype: A character string indicating which column type to filter by. This must be
one of the following:
- ``"numeric"`` - Numeric, but not categoric... | def columns_by_type(self, coltype="numeric"):
"""
Extract columns of the specified type from the frame.
:param str coltype: A character string indicating which column type to filter by. This must be
one of the following:
- ``"numeric"`` - Numeric, but not categoric... | [
"Extract",
"columns",
"of",
"the",
"specified",
"type",
"from",
"the",
"frame",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L379-L397 | [
"def",
"columns_by_type",
"(",
"self",
",",
"coltype",
"=",
"\"numeric\"",
")",
":",
"assert_is_type",
"(",
"coltype",
",",
"\"numeric\"",
",",
"\"categorical\"",
",",
"\"string\"",
",",
"\"time\"",
",",
"\"uuid\"",
",",
"\"bad\"",
")",
"assert_is_type",
"(",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.show | Used by the H2OFrame.__repr__ method to print or display a snippet of the data frame.
If called from IPython, displays an html'ized result. Else prints a tabulate'd result. | h2o-py/h2o/frame.py | def show(self, use_pandas=False, rows=10, cols=200):
"""
Used by the H2OFrame.__repr__ method to print or display a snippet of the data frame.
If called from IPython, displays an html'ized result. Else prints a tabulate'd result.
"""
if self._ex is None:
print("This ... | def show(self, use_pandas=False, rows=10, cols=200):
"""
Used by the H2OFrame.__repr__ method to print or display a snippet of the data frame.
If called from IPython, displays an html'ized result. Else prints a tabulate'd result.
"""
if self._ex is None:
print("This ... | [
"Used",
"by",
"the",
"H2OFrame",
".",
"__repr__",
"method",
"to",
"print",
"or",
"display",
"a",
"snippet",
"of",
"the",
"data",
"frame",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L423-L456 | [
"def",
"show",
"(",
"self",
",",
"use_pandas",
"=",
"False",
",",
"rows",
"=",
"10",
",",
"cols",
"=",
"200",
")",
":",
"if",
"self",
".",
"_ex",
"is",
"None",
":",
"print",
"(",
"\"This H2OFrame has been removed.\"",
")",
"return",
"if",
"not",
"self"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.summary | Display summary information about the frame.
Summary includes min/mean/max/sigma and other rollup data.
:param bool return_data: Return a dictionary of the summary output | h2o-py/h2o/frame.py | def summary(self, return_data=False):
"""
Display summary information about the frame.
Summary includes min/mean/max/sigma and other rollup data.
:param bool return_data: Return a dictionary of the summary output
"""
if not self._has_content():
print("This H... | def summary(self, return_data=False):
"""
Display summary information about the frame.
Summary includes min/mean/max/sigma and other rollup data.
:param bool return_data: Return a dictionary of the summary output
"""
if not self._has_content():
print("This H... | [
"Display",
"summary",
"information",
"about",
"the",
"frame",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L459-L480 | [
"def",
"summary",
"(",
"self",
",",
"return_data",
"=",
"False",
")",
":",
"if",
"not",
"self",
".",
"_has_content",
"(",
")",
":",
"print",
"(",
"\"This H2OFrame is empty and not initialized.\"",
")",
"return",
"self",
".",
"_ex",
".",
"_cache",
".",
"_data... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.describe | Generate an in-depth description of this H2OFrame.
This will print to the console the dimensions of the frame; names/types/summary statistics for each column;
and finally first ten rows of the frame.
:param bool chunk_summary: Retrieve the chunk summary along with the distribution summary | h2o-py/h2o/frame.py | def describe(self, chunk_summary=False):
"""
Generate an in-depth description of this H2OFrame.
This will print to the console the dimensions of the frame; names/types/summary statistics for each column;
and finally first ten rows of the frame.
:param bool chunk_summary: Retrie... | def describe(self, chunk_summary=False):
"""
Generate an in-depth description of this H2OFrame.
This will print to the console the dimensions of the frame; names/types/summary statistics for each column;
and finally first ten rows of the frame.
:param bool chunk_summary: Retrie... | [
"Generate",
"an",
"in",
"-",
"depth",
"description",
"of",
"this",
"H2OFrame",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L483-L504 | [
"def",
"describe",
"(",
"self",
",",
"chunk_summary",
"=",
"False",
")",
":",
"if",
"self",
".",
"_has_content",
"(",
")",
":",
"res",
"=",
"h2o",
".",
"api",
"(",
"\"GET /3/Frames/%s\"",
"%",
"self",
".",
"frame_id",
",",
"data",
"=",
"{",
"\"row_coun... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.head | Return the first ``rows`` and ``cols`` of the frame as a new H2OFrame.
:param int rows: maximum number of rows to return
:param int cols: maximum number of columns to return
:returns: a new H2OFrame cut from the top left corner of the current frame, and having dimensions at
most ``r... | h2o-py/h2o/frame.py | def head(self, rows=10, cols=200):
"""
Return the first ``rows`` and ``cols`` of the frame as a new H2OFrame.
:param int rows: maximum number of rows to return
:param int cols: maximum number of columns to return
:returns: a new H2OFrame cut from the top left corner of the curre... | def head(self, rows=10, cols=200):
"""
Return the first ``rows`` and ``cols`` of the frame as a new H2OFrame.
:param int rows: maximum number of rows to return
:param int cols: maximum number of columns to return
:returns: a new H2OFrame cut from the top left corner of the curre... | [
"Return",
"the",
"first",
"rows",
"and",
"cols",
"of",
"the",
"frame",
"as",
"a",
"new",
"H2OFrame",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L514-L528 | [
"def",
"head",
"(",
"self",
",",
"rows",
"=",
"10",
",",
"cols",
"=",
"200",
")",
":",
"assert_is_type",
"(",
"rows",
",",
"int",
")",
"assert_is_type",
"(",
"cols",
",",
"int",
")",
"nrows",
"=",
"min",
"(",
"self",
".",
"nrows",
",",
"rows",
")... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.mult | Multiply this frame, viewed as a matrix, by another matrix.
:param matrix: another frame that you want to multiply the current frame by; must be compatible with the
current frame (i.e. its number of rows must be the same as number of columns in the current frame).
:returns: new H2OFrame, wh... | h2o-py/h2o/frame.py | def mult(self, matrix):
"""
Multiply this frame, viewed as a matrix, by another matrix.
:param matrix: another frame that you want to multiply the current frame by; must be compatible with the
current frame (i.e. its number of rows must be the same as number of columns in the curren... | def mult(self, matrix):
"""
Multiply this frame, viewed as a matrix, by another matrix.
:param matrix: another frame that you want to multiply the current frame by; must be compatible with the
current frame (i.e. its number of rows must be the same as number of columns in the curren... | [
"Multiply",
"this",
"frame",
"viewed",
"as",
"a",
"matrix",
"by",
"another",
"matrix",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L697-L707 | [
"def",
"mult",
"(",
"self",
",",
"matrix",
")",
":",
"if",
"self",
".",
"ncols",
"!=",
"matrix",
".",
"nrows",
":",
"raise",
"H2OValueError",
"(",
"\"Matrix is not compatible for multiplication with the current frame\"",
")",
"return",
"H2OFrame",
".",
"_expr",
"(... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.moment | Create a time column from individual components.
Each parameter should be either an integer, or a single-column H2OFrame
containing the corresponding time parts for each row.
The "date" part of the timestamp can be specified using either the tuple ``(year, month, day)``, or an
explicit... | h2o-py/h2o/frame.py | def moment(year=None, month=None, day=None, hour=None, minute=None, second=None, msec=None, date=None, time=None):
"""
Create a time column from individual components.
Each parameter should be either an integer, or a single-column H2OFrame
containing the corresponding time parts for eac... | def moment(year=None, month=None, day=None, hour=None, minute=None, second=None, msec=None, date=None, time=None):
"""
Create a time column from individual components.
Each parameter should be either an integer, or a single-column H2OFrame
containing the corresponding time parts for eac... | [
"Create",
"a",
"time",
"column",
"from",
"individual",
"components",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L885-L976 | [
"def",
"moment",
"(",
"year",
"=",
"None",
",",
"month",
"=",
"None",
",",
"day",
"=",
"None",
",",
"hour",
"=",
"None",
",",
"minute",
"=",
"None",
",",
"second",
"=",
"None",
",",
"msec",
"=",
"None",
",",
"date",
"=",
"None",
",",
"time",
"=... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.levels | Get the factor levels.
:returns: A list of lists, one list per column, of levels. | h2o-py/h2o/frame.py | def levels(self):
"""
Get the factor levels.
:returns: A list of lists, one list per column, of levels.
"""
lol = H2OFrame._expr(expr=ExprNode("levels", self)).as_data_frame(False)
lol.pop(0) # Remove column headers
lol = list(zip(*lol))
return [[ll for ... | def levels(self):
"""
Get the factor levels.
:returns: A list of lists, one list per column, of levels.
"""
lol = H2OFrame._expr(expr=ExprNode("levels", self)).as_data_frame(False)
lol.pop(0) # Remove column headers
lol = list(zip(*lol))
return [[ll for ... | [
"Get",
"the",
"factor",
"levels",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L988-L997 | [
"def",
"levels",
"(",
"self",
")",
":",
"lol",
"=",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"levels\"",
",",
"self",
")",
")",
".",
"as_data_frame",
"(",
"False",
")",
"lol",
".",
"pop",
"(",
"0",
")",
"# Remove column headers",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.nlevels | Get the number of factor levels for each categorical column.
:returns: A list of the number of levels per column. | h2o-py/h2o/frame.py | def nlevels(self):
"""
Get the number of factor levels for each categorical column.
:returns: A list of the number of levels per column.
"""
levels = self.levels()
return [len(l) for l in levels] if levels else 0 | def nlevels(self):
"""
Get the number of factor levels for each categorical column.
:returns: A list of the number of levels per column.
"""
levels = self.levels()
return [len(l) for l in levels] if levels else 0 | [
"Get",
"the",
"number",
"of",
"factor",
"levels",
"for",
"each",
"categorical",
"column",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1000-L1007 | [
"def",
"nlevels",
"(",
"self",
")",
":",
"levels",
"=",
"self",
".",
"levels",
"(",
")",
"return",
"[",
"len",
"(",
"l",
")",
"for",
"l",
"in",
"levels",
"]",
"if",
"levels",
"else",
"0"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.set_level | A method to set all column values to one of the levels.
:param str level: The level at which the column will be set (a string)
:returns: H2OFrame with entries set to the desired level. | h2o-py/h2o/frame.py | def set_level(self, level):
"""
A method to set all column values to one of the levels.
:param str level: The level at which the column will be set (a string)
:returns: H2OFrame with entries set to the desired level.
"""
return H2OFrame._expr(expr=ExprNode("setLevel", s... | def set_level(self, level):
"""
A method to set all column values to one of the levels.
:param str level: The level at which the column will be set (a string)
:returns: H2OFrame with entries set to the desired level.
"""
return H2OFrame._expr(expr=ExprNode("setLevel", s... | [
"A",
"method",
"to",
"set",
"all",
"column",
"values",
"to",
"one",
"of",
"the",
"levels",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1010-L1018 | [
"def",
"set_level",
"(",
"self",
",",
"level",
")",
":",
"return",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"setLevel\"",
",",
"self",
",",
"level",
")",
",",
"cache",
"=",
"self",
".",
"_ex",
".",
"_cache",
")"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.set_levels | Replace the levels of a categorical column.
New levels must be aligned with the old domain. This call has copy-on-write semantics.
:param List[str] levels: A list of strings specifying the new levels. The number of new
levels must match the number of old levels.
:returns: A single-... | h2o-py/h2o/frame.py | def set_levels(self, levels):
"""
Replace the levels of a categorical column.
New levels must be aligned with the old domain. This call has copy-on-write semantics.
:param List[str] levels: A list of strings specifying the new levels. The number of new
levels must match the... | def set_levels(self, levels):
"""
Replace the levels of a categorical column.
New levels must be aligned with the old domain. This call has copy-on-write semantics.
:param List[str] levels: A list of strings specifying the new levels. The number of new
levels must match the... | [
"Replace",
"the",
"levels",
"of",
"a",
"categorical",
"column",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1021-L1032 | [
"def",
"set_levels",
"(",
"self",
",",
"levels",
")",
":",
"assert_is_type",
"(",
"levels",
",",
"[",
"str",
"]",
")",
"return",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"setDomain\"",
",",
"self",
",",
"False",
",",
"levels",
")"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.rename | Change names of columns in the frame.
Dict key is an index or name of the column whose name is to be set.
Dict value is the new name of the column.
:param columns: dict-like transformations to apply to the column names | h2o-py/h2o/frame.py | def rename(self, columns=None):
"""
Change names of columns in the frame.
Dict key is an index or name of the column whose name is to be set.
Dict value is the new name of the column.
:param columns: dict-like transformations to apply to the column names
"""
ass... | def rename(self, columns=None):
"""
Change names of columns in the frame.
Dict key is an index or name of the column whose name is to be set.
Dict value is the new name of the column.
:param columns: dict-like transformations to apply to the column names
"""
ass... | [
"Change",
"names",
"of",
"columns",
"in",
"the",
"frame",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1035-L1058 | [
"def",
"rename",
"(",
"self",
",",
"columns",
"=",
"None",
")",
":",
"assert_is_type",
"(",
"columns",
",",
"None",
",",
"dict",
")",
"new_names",
"=",
"self",
".",
"names",
"ncols",
"=",
"self",
".",
"ncols",
"for",
"col",
",",
"name",
"in",
"column... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.set_names | Change names of all columns in the frame.
:param List[str] names: The list of new names for every column in the frame. | h2o-py/h2o/frame.py | def set_names(self, names):
"""
Change names of all columns in the frame.
:param List[str] names: The list of new names for every column in the frame.
"""
assert_is_type(names, [str])
assert_satisfies(names, len(names) == self.ncol)
self._ex = ExprNode("colnames=... | def set_names(self, names):
"""
Change names of all columns in the frame.
:param List[str] names: The list of new names for every column in the frame.
"""
assert_is_type(names, [str])
assert_satisfies(names, len(names) == self.ncol)
self._ex = ExprNode("colnames=... | [
"Change",
"names",
"of",
"all",
"columns",
"in",
"the",
"frame",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1061-L1070 | [
"def",
"set_names",
"(",
"self",
",",
"names",
")",
":",
"assert_is_type",
"(",
"names",
",",
"[",
"str",
"]",
")",
"assert_satisfies",
"(",
"names",
",",
"len",
"(",
"names",
")",
"==",
"self",
".",
"ncol",
")",
"self",
".",
"_ex",
"=",
"ExprNode",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.set_name | Set a new name for a column.
:param col: index or name of the column whose name is to be set; may be skipped for 1-column frames
:param name: the new name of the column | h2o-py/h2o/frame.py | def set_name(self, col=None, name=None):
"""
Set a new name for a column.
:param col: index or name of the column whose name is to be set; may be skipped for 1-column frames
:param name: the new name of the column
"""
assert_is_type(col, None, int, str)
assert_is... | def set_name(self, col=None, name=None):
"""
Set a new name for a column.
:param col: index or name of the column whose name is to be set; may be skipped for 1-column frames
:param name: the new name of the column
"""
assert_is_type(col, None, int, str)
assert_is... | [
"Set",
"a",
"new",
"name",
"for",
"a",
"column",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1073-L1110 | [
"def",
"set_name",
"(",
"self",
",",
"col",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"assert_is_type",
"(",
"col",
",",
"None",
",",
"int",
",",
"str",
")",
"assert_is_type",
"(",
"name",
",",
"str",
")",
"ncols",
"=",
"self",
".",
"ncols",... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.cumsum | Compute cumulative sum over rows / columns of the frame.
:param int axis: 0 for column-wise, 1 for row-wise
:returns: new H2OFrame with cumulative sums of the original frame. | h2o-py/h2o/frame.py | def cumsum(self, axis=0):
"""
Compute cumulative sum over rows / columns of the frame.
:param int axis: 0 for column-wise, 1 for row-wise
:returns: new H2OFrame with cumulative sums of the original frame.
"""
return H2OFrame._expr(expr=ExprNode("cumsum", self, axis), ca... | def cumsum(self, axis=0):
"""
Compute cumulative sum over rows / columns of the frame.
:param int axis: 0 for column-wise, 1 for row-wise
:returns: new H2OFrame with cumulative sums of the original frame.
"""
return H2OFrame._expr(expr=ExprNode("cumsum", self, axis), ca... | [
"Compute",
"cumulative",
"sum",
"over",
"rows",
"/",
"columns",
"of",
"the",
"frame",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1126-L1133 | [
"def",
"cumsum",
"(",
"self",
",",
"axis",
"=",
"0",
")",
":",
"return",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"cumsum\"",
",",
"self",
",",
"axis",
")",
",",
"cache",
"=",
"self",
".",
"_ex",
".",
"_cache",
")"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.isin | Test whether elements of an H2OFrame are contained in the ``item``.
:param items: An item or a list of items to compare the H2OFrame against.
:returns: An H2OFrame of 0s and 1s showing whether each element in the original H2OFrame is contained in item. | h2o-py/h2o/frame.py | def isin(self, item):
"""
Test whether elements of an H2OFrame are contained in the ``item``.
:param items: An item or a list of items to compare the H2OFrame against.
:returns: An H2OFrame of 0s and 1s showing whether each element in the original H2OFrame is contained in item.
... | def isin(self, item):
"""
Test whether elements of an H2OFrame are contained in the ``item``.
:param items: An item or a list of items to compare the H2OFrame against.
:returns: An H2OFrame of 0s and 1s showing whether each element in the original H2OFrame is contained in item.
... | [
"Test",
"whether",
"elements",
"of",
"an",
"H2OFrame",
"are",
"contained",
"in",
"the",
"item",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1210-L1224 | [
"def",
"isin",
"(",
"self",
",",
"item",
")",
":",
"if",
"is_type",
"(",
"item",
",",
"list",
",",
"tuple",
",",
"set",
")",
":",
"if",
"self",
".",
"ncols",
"==",
"1",
"and",
"(",
"self",
".",
"type",
"(",
"0",
")",
"==",
"'str'",
"or",
"sel... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.modulo_kfold_column | Build a fold assignments column for cross-validation.
Rows are assigned a fold according to the current row number modulo ``n_folds``.
:param int n_folds: An integer specifying the number of validation sets to split the training data into.
:returns: A single-column H2OFrame with the fold assig... | h2o-py/h2o/frame.py | def modulo_kfold_column(self, n_folds=3):
"""
Build a fold assignments column for cross-validation.
Rows are assigned a fold according to the current row number modulo ``n_folds``.
:param int n_folds: An integer specifying the number of validation sets to split the training data into.
... | def modulo_kfold_column(self, n_folds=3):
"""
Build a fold assignments column for cross-validation.
Rows are assigned a fold according to the current row number modulo ``n_folds``.
:param int n_folds: An integer specifying the number of validation sets to split the training data into.
... | [
"Build",
"a",
"fold",
"assignments",
"column",
"for",
"cross",
"-",
"validation",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1241-L1250 | [
"def",
"modulo_kfold_column",
"(",
"self",
",",
"n_folds",
"=",
"3",
")",
":",
"return",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"modulo_kfold_column\"",
",",
"self",
",",
"n_folds",
")",
")",
".",
"_frame",
"(",
")"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.stratified_kfold_column | Build a fold assignment column with the constraint that each fold has the same class
distribution as the fold column.
:param int n_folds: The number of folds to build.
:param int seed: A seed for the random number generator.
:returns: A single column H2OFrame with the fold assignments. | h2o-py/h2o/frame.py | def stratified_kfold_column(self, n_folds=3, seed=-1):
"""
Build a fold assignment column with the constraint that each fold has the same class
distribution as the fold column.
:param int n_folds: The number of folds to build.
:param int seed: A seed for the random number genera... | def stratified_kfold_column(self, n_folds=3, seed=-1):
"""
Build a fold assignment column with the constraint that each fold has the same class
distribution as the fold column.
:param int n_folds: The number of folds to build.
:param int seed: A seed for the random number genera... | [
"Build",
"a",
"fold",
"assignment",
"column",
"with",
"the",
"constraint",
"that",
"each",
"fold",
"has",
"the",
"same",
"class",
"distribution",
"as",
"the",
"fold",
"column",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1253-L1264 | [
"def",
"stratified_kfold_column",
"(",
"self",
",",
"n_folds",
"=",
"3",
",",
"seed",
"=",
"-",
"1",
")",
":",
"return",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"stratified_kfold_column\"",
",",
"self",
",",
"n_folds",
",",
"seed",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.structure | Compactly display the internal structure of an H2OFrame. | h2o-py/h2o/frame.py | def structure(self):
"""Compactly display the internal structure of an H2OFrame."""
df = self.as_data_frame(use_pandas=False)
cn = df.pop(0)
nr = self.nrow
nc = self.ncol
width = max([len(c) for c in cn])
isfactor = self.isfactor()
numlevels = self.nlevels... | def structure(self):
"""Compactly display the internal structure of an H2OFrame."""
df = self.as_data_frame(use_pandas=False)
cn = df.pop(0)
nr = self.nrow
nc = self.ncol
width = max([len(c) for c in cn])
isfactor = self.isfactor()
numlevels = self.nlevels... | [
"Compactly",
"display",
"the",
"internal",
"structure",
"of",
"an",
"H2OFrame",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1267-L1284 | [
"def",
"structure",
"(",
"self",
")",
":",
"df",
"=",
"self",
".",
"as_data_frame",
"(",
"use_pandas",
"=",
"False",
")",
"cn",
"=",
"df",
".",
"pop",
"(",
"0",
")",
"nr",
"=",
"self",
".",
"nrow",
"nc",
"=",
"self",
".",
"ncol",
"width",
"=",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.as_data_frame | Obtain the dataset as a python-local object.
:param bool use_pandas: If True (default) then return the H2OFrame as a pandas DataFrame (requires that the
``pandas`` library was installed). If False, then return the contents of the H2OFrame as plain nested
list, in a row-wise order.
... | h2o-py/h2o/frame.py | def as_data_frame(self, use_pandas=True, header=True):
"""
Obtain the dataset as a python-local object.
:param bool use_pandas: If True (default) then return the H2OFrame as a pandas DataFrame (requires that the
``pandas`` library was installed). If False, then return the contents o... | def as_data_frame(self, use_pandas=True, header=True):
"""
Obtain the dataset as a python-local object.
:param bool use_pandas: If True (default) then return the H2OFrame as a pandas DataFrame (requires that the
``pandas`` library was installed). If False, then return the contents o... | [
"Obtain",
"the",
"dataset",
"as",
"a",
"python",
"-",
"local",
"object",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1286-L1305 | [
"def",
"as_data_frame",
"(",
"self",
",",
"use_pandas",
"=",
"True",
",",
"header",
"=",
"True",
")",
":",
"if",
"can_use_pandas",
"(",
")",
"and",
"use_pandas",
":",
"import",
"pandas",
"return",
"pandas",
".",
"read_csv",
"(",
"StringIO",
"(",
"self",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.drop | Drop a single column or row or a set of columns or rows from a H2OFrame.
Dropping a column or row is not in-place.
Indices of rows and columns are zero-based.
:param index: A list of column indices, column names, or row indices to drop; or
a string to drop a single column by name; ... | h2o-py/h2o/frame.py | def drop(self, index, axis=1):
"""
Drop a single column or row or a set of columns or rows from a H2OFrame.
Dropping a column or row is not in-place.
Indices of rows and columns are zero-based.
:param index: A list of column indices, column names, or row indices to drop; or
... | def drop(self, index, axis=1):
"""
Drop a single column or row or a set of columns or rows from a H2OFrame.
Dropping a column or row is not in-place.
Indices of rows and columns are zero-based.
:param index: A list of column indices, column names, or row indices to drop; or
... | [
"Drop",
"a",
"single",
"column",
"or",
"row",
"or",
"a",
"set",
"of",
"columns",
"or",
"rows",
"from",
"a",
"H2OFrame",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1550-L1626 | [
"def",
"drop",
"(",
"self",
",",
"index",
",",
"axis",
"=",
"1",
")",
":",
"if",
"axis",
"==",
"1",
":",
"if",
"not",
"isinstance",
"(",
"index",
",",
"list",
")",
":",
"#If input is a string, i.e., \"C1\":",
"if",
"is_type",
"(",
"index",
",",
"str",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.pop | Pop a column from the H2OFrame at index i.
:param i: The index (int) or name (str) of the column to pop.
:returns: an H2OFrame containing the column dropped from the current frame; the current frame is modified
in-place and loses the column. | h2o-py/h2o/frame.py | def pop(self, i):
"""
Pop a column from the H2OFrame at index i.
:param i: The index (int) or name (str) of the column to pop.
:returns: an H2OFrame containing the column dropped from the current frame; the current frame is modified
in-place and loses the column.
"""... | def pop(self, i):
"""
Pop a column from the H2OFrame at index i.
:param i: The index (int) or name (str) of the column to pop.
:returns: an H2OFrame containing the column dropped from the current frame; the current frame is modified
in-place and loses the column.
"""... | [
"Pop",
"a",
"column",
"from",
"the",
"H2OFrame",
"at",
"index",
"i",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1629-L1647 | [
"def",
"pop",
"(",
"self",
",",
"i",
")",
":",
"if",
"is_type",
"(",
"i",
",",
"str",
")",
":",
"i",
"=",
"self",
".",
"names",
".",
"index",
"(",
"i",
")",
"col",
"=",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"cols\"",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.quantile | Compute quantiles.
:param List[float] prob: list of probabilities for which quantiles should be computed.
:param str combine_method: for even samples this setting determines how to combine quantiles. This can be
one of ``"interpolate"``, ``"average"``, ``"low"``, ``"high"``.
:param ... | h2o-py/h2o/frame.py | def quantile(self, prob=None, combine_method="interpolate", weights_column=None):
"""
Compute quantiles.
:param List[float] prob: list of probabilities for which quantiles should be computed.
:param str combine_method: for even samples this setting determines how to combine quantiles. T... | def quantile(self, prob=None, combine_method="interpolate", weights_column=None):
"""
Compute quantiles.
:param List[float] prob: list of probabilities for which quantiles should be computed.
:param str combine_method: for even samples this setting determines how to combine quantiles. T... | [
"Compute",
"quantiles",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1650-L1673 | [
"def",
"quantile",
"(",
"self",
",",
"prob",
"=",
"None",
",",
"combine_method",
"=",
"\"interpolate\"",
",",
"weights_column",
"=",
"None",
")",
":",
"if",
"len",
"(",
"self",
")",
"==",
"0",
":",
"return",
"self",
"if",
"prob",
"is",
"None",
":",
"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.concat | Append multiple H2OFrames to this frame, column-wise or row-wise.
:param List[H2OFrame] frames: list of frames that should be appended to the current frame.
:param int axis: if 1 then append column-wise (default), if 0 then append row-wise.
:returns: an H2OFrame of the combined datasets. | h2o-py/h2o/frame.py | def concat(self, frames, axis=1):
"""
Append multiple H2OFrames to this frame, column-wise or row-wise.
:param List[H2OFrame] frames: list of frames that should be appended to the current frame.
:param int axis: if 1 then append column-wise (default), if 0 then append row-wise.
... | def concat(self, frames, axis=1):
"""
Append multiple H2OFrames to this frame, column-wise or row-wise.
:param List[H2OFrame] frames: list of frames that should be appended to the current frame.
:param int axis: if 1 then append column-wise (default), if 0 then append row-wise.
... | [
"Append",
"multiple",
"H2OFrames",
"to",
"this",
"frame",
"column",
"-",
"wise",
"or",
"row",
"-",
"wise",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1676-L1692 | [
"def",
"concat",
"(",
"self",
",",
"frames",
",",
"axis",
"=",
"1",
")",
":",
"if",
"len",
"(",
"frames",
")",
"==",
"0",
":",
"raise",
"ValueError",
"(",
"\"Input list of frames is empty! Nothing to concat.\"",
")",
"if",
"axis",
"==",
"1",
":",
"df",
"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.cbind | Append data to this frame column-wise.
:param H2OFrame data: append columns of frame ``data`` to the current frame. You can also cbind a number,
in which case it will get converted into a constant column.
:returns: new H2OFrame with all frames in ``data`` appended column-wise. | h2o-py/h2o/frame.py | def cbind(self, data):
"""
Append data to this frame column-wise.
:param H2OFrame data: append columns of frame ``data`` to the current frame. You can also cbind a number,
in which case it will get converted into a constant column.
:returns: new H2OFrame with all frames in ... | def cbind(self, data):
"""
Append data to this frame column-wise.
:param H2OFrame data: append columns of frame ``data`` to the current frame. You can also cbind a number,
in which case it will get converted into a constant column.
:returns: new H2OFrame with all frames in ... | [
"Append",
"data",
"to",
"this",
"frame",
"column",
"-",
"wise",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1695-L1727 | [
"def",
"cbind",
"(",
"self",
",",
"data",
")",
":",
"assert_is_type",
"(",
"data",
",",
"H2OFrame",
",",
"numeric",
",",
"[",
"H2OFrame",
",",
"numeric",
"]",
")",
"frames",
"=",
"[",
"data",
"]",
"if",
"not",
"isinstance",
"(",
"data",
",",
"list",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.rbind | Append data to this frame row-wise.
:param data: an H2OFrame or a list of H2OFrame's to be combined with current frame row-wise.
:returns: this H2OFrame with all frames in data appended row-wise. | h2o-py/h2o/frame.py | def rbind(self, data):
"""
Append data to this frame row-wise.
:param data: an H2OFrame or a list of H2OFrame's to be combined with current frame row-wise.
:returns: this H2OFrame with all frames in data appended row-wise.
"""
assert_is_type(data, H2OFrame, [H2OFrame])
... | def rbind(self, data):
"""
Append data to this frame row-wise.
:param data: an H2OFrame or a list of H2OFrame's to be combined with current frame row-wise.
:returns: this H2OFrame with all frames in data appended row-wise.
"""
assert_is_type(data, H2OFrame, [H2OFrame])
... | [
"Append",
"data",
"to",
"this",
"frame",
"row",
"-",
"wise",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1730-L1747 | [
"def",
"rbind",
"(",
"self",
",",
"data",
")",
":",
"assert_is_type",
"(",
"data",
",",
"H2OFrame",
",",
"[",
"H2OFrame",
"]",
")",
"frames",
"=",
"[",
"data",
"]",
"if",
"not",
"isinstance",
"(",
"data",
",",
"list",
")",
"else",
"data",
"for",
"f... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.split_frame | Split a frame into distinct subsets of size determined by the given ratios.
The number of subsets is always 1 more than the number of ratios given. Note that
this does not give an exact split. H2O is designed to be efficient on big data
using a probabilistic splitting method rather than an exac... | h2o-py/h2o/frame.py | def split_frame(self, ratios=None, destination_frames=None, seed=None):
"""
Split a frame into distinct subsets of size determined by the given ratios.
The number of subsets is always 1 more than the number of ratios given. Note that
this does not give an exact split. H2O is designed to... | def split_frame(self, ratios=None, destination_frames=None, seed=None):
"""
Split a frame into distinct subsets of size determined by the given ratios.
The number of subsets is always 1 more than the number of ratios given. Note that
this does not give an exact split. H2O is designed to... | [
"Split",
"a",
"frame",
"into",
"distinct",
"subsets",
"of",
"size",
"determined",
"by",
"the",
"given",
"ratios",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1750-L1827 | [
"def",
"split_frame",
"(",
"self",
",",
"ratios",
"=",
"None",
",",
"destination_frames",
"=",
"None",
",",
"seed",
"=",
"None",
")",
":",
"assert_is_type",
"(",
"ratios",
",",
"[",
"numeric",
"]",
",",
"None",
")",
"assert_is_type",
"(",
"destination_fram... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.group_by | Return a new ``GroupBy`` object using this frame and the desired grouping columns.
The returned groups are sorted by the natural group-by column sort.
:param by: The columns to group on (either a single column name, or a list of column names, or
a list of column indices). | h2o-py/h2o/frame.py | def group_by(self, by):
"""
Return a new ``GroupBy`` object using this frame and the desired grouping columns.
The returned groups are sorted by the natural group-by column sort.
:param by: The columns to group on (either a single column name, or a list of column names, or
... | def group_by(self, by):
"""
Return a new ``GroupBy`` object using this frame and the desired grouping columns.
The returned groups are sorted by the natural group-by column sort.
:param by: The columns to group on (either a single column name, or a list of column names, or
... | [
"Return",
"a",
"new",
"GroupBy",
"object",
"using",
"this",
"frame",
"and",
"the",
"desired",
"grouping",
"columns",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1830-L1840 | [
"def",
"group_by",
"(",
"self",
",",
"by",
")",
":",
"assert_is_type",
"(",
"by",
",",
"str",
",",
"int",
",",
"[",
"str",
",",
"int",
"]",
")",
"return",
"GroupBy",
"(",
"self",
",",
"by",
")"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.sort | Return a new Frame that is sorted by column(s) in ascending order. A fully distributed and parallel sort.
However, the original frame can contain String columns but sorting cannot be done on String columns.
Default sorting direction is ascending.
:param by: The column to sort by (either a singl... | h2o-py/h2o/frame.py | def sort(self, by, ascending=[]):
"""
Return a new Frame that is sorted by column(s) in ascending order. A fully distributed and parallel sort.
However, the original frame can contain String columns but sorting cannot be done on String columns.
Default sorting direction is ascending.
... | def sort(self, by, ascending=[]):
"""
Return a new Frame that is sorted by column(s) in ascending order. A fully distributed and parallel sort.
However, the original frame can contain String columns but sorting cannot be done on String columns.
Default sorting direction is ascending.
... | [
"Return",
"a",
"new",
"Frame",
"that",
"is",
"sorted",
"by",
"column",
"(",
"s",
")",
"in",
"ascending",
"order",
".",
"A",
"fully",
"distributed",
"and",
"parallel",
"sort",
".",
"However",
"the",
"original",
"frame",
"can",
"contain",
"String",
"columns"... | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1842-L1866 | [
"def",
"sort",
"(",
"self",
",",
"by",
",",
"ascending",
"=",
"[",
"]",
")",
":",
"assert_is_type",
"(",
"by",
",",
"str",
",",
"int",
",",
"[",
"str",
",",
"int",
"]",
")",
"if",
"type",
"(",
"by",
")",
"!=",
"list",
":",
"by",
"=",
"[",
"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.fillna | Return a new Frame that fills NA along a given axis and along a given direction with a maximum fill length
:param method: ``"forward"`` or ``"backward"``
:param axis: 0 for columnar-wise or 1 for row-wise fill
:param maxlen: Max number of consecutive NA's to fill
:return: | h2o-py/h2o/frame.py | def fillna(self,method="forward",axis=0,maxlen=1):
"""
Return a new Frame that fills NA along a given axis and along a given direction with a maximum fill length
:param method: ``"forward"`` or ``"backward"``
:param axis: 0 for columnar-wise or 1 for row-wise fill
:param maxlen... | def fillna(self,method="forward",axis=0,maxlen=1):
"""
Return a new Frame that fills NA along a given axis and along a given direction with a maximum fill length
:param method: ``"forward"`` or ``"backward"``
:param axis: 0 for columnar-wise or 1 for row-wise fill
:param maxlen... | [
"Return",
"a",
"new",
"Frame",
"that",
"fills",
"NA",
"along",
"a",
"given",
"axis",
"and",
"along",
"a",
"given",
"direction",
"with",
"a",
"maximum",
"fill",
"length"
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1868-L1881 | [
"def",
"fillna",
"(",
"self",
",",
"method",
"=",
"\"forward\"",
",",
"axis",
"=",
"0",
",",
"maxlen",
"=",
"1",
")",
":",
"assert_is_type",
"(",
"axis",
",",
"0",
",",
"1",
")",
"assert_is_type",
"(",
"method",
",",
"str",
")",
"assert_is_type",
"("... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.impute | Impute missing values into the frame, modifying it in-place.
:param int column: Index of the column to impute, or -1 to impute the entire frame.
:param str method: The method of imputation: ``"mean"``, ``"median"``, or ``"mode"``.
:param str combine_method: When the method is ``"median"``, this... | h2o-py/h2o/frame.py | def impute(self, column=-1, method="mean", combine_method="interpolate", by=None, group_by_frame=None, values=None):
"""
Impute missing values into the frame, modifying it in-place.
:param int column: Index of the column to impute, or -1 to impute the entire frame.
:param str method: Th... | def impute(self, column=-1, method="mean", combine_method="interpolate", by=None, group_by_frame=None, values=None):
"""
Impute missing values into the frame, modifying it in-place.
:param int column: Index of the column to impute, or -1 to impute the entire frame.
:param str method: Th... | [
"Impute",
"missing",
"values",
"into",
"the",
"frame",
"modifying",
"it",
"in",
"-",
"place",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1883-L1933 | [
"def",
"impute",
"(",
"self",
",",
"column",
"=",
"-",
"1",
",",
"method",
"=",
"\"mean\"",
",",
"combine_method",
"=",
"\"interpolate\"",
",",
"by",
"=",
"None",
",",
"group_by_frame",
"=",
"None",
",",
"values",
"=",
"None",
")",
":",
"if",
"is_type"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.merge | Merge two datasets based on common column names. We do not support all_x=True and all_y=True.
Only one can be True or none is True. The default merge method is auto and it will default to the
radix method. The radix method will return the correct merge result regardless of duplicated rows
in... | h2o-py/h2o/frame.py | def merge(self, other, all_x=False, all_y=False, by_x=None, by_y=None, method="auto"):
"""
Merge two datasets based on common column names. We do not support all_x=True and all_y=True.
Only one can be True or none is True. The default merge method is auto and it will default to the
rad... | def merge(self, other, all_x=False, all_y=False, by_x=None, by_y=None, method="auto"):
"""
Merge two datasets based on common column names. We do not support all_x=True and all_y=True.
Only one can be True or none is True. The default merge method is auto and it will default to the
rad... | [
"Merge",
"two",
"datasets",
"based",
"on",
"common",
"column",
"names",
".",
"We",
"do",
"not",
"support",
"all_x",
"=",
"True",
"and",
"all_y",
"=",
"True",
".",
"Only",
"one",
"can",
"be",
"True",
"or",
"none",
"is",
"True",
".",
"The",
"default",
... | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1936-L1975 | [
"def",
"merge",
"(",
"self",
",",
"other",
",",
"all_x",
"=",
"False",
",",
"all_y",
"=",
"False",
",",
"by_x",
"=",
"None",
",",
"by_y",
"=",
"None",
",",
"method",
"=",
"\"auto\"",
")",
":",
"if",
"by_x",
"is",
"None",
"and",
"by_y",
"is",
"Non... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.relevel | Reorder levels of an H2O factor for one single column of a H2O frame
The levels of a factor are reordered such that the reference level is at level 0, all remaining levels are
moved down as needed.
:param str y: The reference level
:returns: New reordered factor column | h2o-py/h2o/frame.py | def relevel(self, y):
"""
Reorder levels of an H2O factor for one single column of a H2O frame
The levels of a factor are reordered such that the reference level is at level 0, all remaining levels are
moved down as needed.
:param str y: The reference level
:returns: Ne... | def relevel(self, y):
"""
Reorder levels of an H2O factor for one single column of a H2O frame
The levels of a factor are reordered such that the reference level is at level 0, all remaining levels are
moved down as needed.
:param str y: The reference level
:returns: Ne... | [
"Reorder",
"levels",
"of",
"an",
"H2O",
"factor",
"for",
"one",
"single",
"column",
"of",
"a",
"H2O",
"frame"
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1978-L1988 | [
"def",
"relevel",
"(",
"self",
",",
"y",
")",
":",
"return",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"relevel\"",
",",
"self",
",",
"quote",
"(",
"y",
")",
")",
")"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.insert_missing_values | Insert missing values into the current frame, modifying it in-place.
Randomly replaces a user-specified fraction of entries in a H2O dataset with missing
values.
:param float fraction: A number between 0 and 1 indicating the fraction of entries to replace with missing.
:param int seed:... | h2o-py/h2o/frame.py | def insert_missing_values(self, fraction=0.1, seed=None):
"""
Insert missing values into the current frame, modifying it in-place.
Randomly replaces a user-specified fraction of entries in a H2O dataset with missing
values.
:param float fraction: A number between 0 and 1 indica... | def insert_missing_values(self, fraction=0.1, seed=None):
"""
Insert missing values into the current frame, modifying it in-place.
Randomly replaces a user-specified fraction of entries in a H2O dataset with missing
values.
:param float fraction: A number between 0 and 1 indica... | [
"Insert",
"missing",
"values",
"into",
"the",
"current",
"frame",
"modifying",
"it",
"in",
"-",
"place",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L1991-L2011 | [
"def",
"insert_missing_values",
"(",
"self",
",",
"fraction",
"=",
"0.1",
",",
"seed",
"=",
"None",
")",
":",
"kwargs",
"=",
"{",
"}",
"kwargs",
"[",
"'dataset'",
"]",
"=",
"self",
".",
"frame_id",
"# Eager; forces eval now for following REST call",
"kwargs",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.sum | Compute the frame's sum by-column (or by-row).
:param bool skipna: If True (default), then NAs are ignored during the computation. Otherwise presence
of NAs renders the entire result NA.
:param int axis: Direction of sum computation. If 0 (default), then sum is computed columnwise, and the ... | h2o-py/h2o/frame.py | def sum(self, skipna=True, axis=0, **kwargs):
"""
Compute the frame's sum by-column (or by-row).
:param bool skipna: If True (default), then NAs are ignored during the computation. Otherwise presence
of NAs renders the entire result NA.
:param int axis: Direction of sum comp... | def sum(self, skipna=True, axis=0, **kwargs):
"""
Compute the frame's sum by-column (or by-row).
:param bool skipna: If True (default), then NAs are ignored during the computation. Otherwise presence
of NAs renders the entire result NA.
:param int axis: Direction of sum comp... | [
"Compute",
"the",
"frame",
"s",
"sum",
"by",
"-",
"column",
"(",
"or",
"by",
"-",
"row",
")",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2024-L2059 | [
"def",
"sum",
"(",
"self",
",",
"skipna",
"=",
"True",
",",
"axis",
"=",
"0",
",",
"*",
"*",
"kwargs",
")",
":",
"assert_is_type",
"(",
"skipna",
",",
"bool",
")",
"assert_is_type",
"(",
"axis",
",",
"0",
",",
"1",
")",
"# Deprecated since 2016-10-14,"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.var | Compute the variance-covariance matrix of one or two H2OFrames.
:param H2OFrame y: If this parameter is given, then a covariance matrix between the columns of the target
frame and the columns of ``y`` is computed. If this parameter is not provided then the covariance matrix
of the targ... | h2o-py/h2o/frame.py | def var(self, y=None, na_rm=False, use=None):
"""
Compute the variance-covariance matrix of one or two H2OFrames.
:param H2OFrame y: If this parameter is given, then a covariance matrix between the columns of the target
frame and the columns of ``y`` is computed. If this parameter ... | def var(self, y=None, na_rm=False, use=None):
"""
Compute the variance-covariance matrix of one or two H2OFrames.
:param H2OFrame y: If this parameter is given, then a covariance matrix between the columns of the target
frame and the columns of ``y`` is computed. If this parameter ... | [
"Compute",
"the",
"variance",
"-",
"covariance",
"matrix",
"of",
"one",
"or",
"two",
"H2OFrames",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2141-L2170 | [
"def",
"var",
"(",
"self",
",",
"y",
"=",
"None",
",",
"na_rm",
"=",
"False",
",",
"use",
"=",
"None",
")",
":",
"symmetric",
"=",
"False",
"if",
"y",
"is",
"None",
":",
"y",
"=",
"self",
"symmetric",
"=",
"True",
"if",
"use",
"is",
"None",
":"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.cor | Compute the correlation matrix of one or two H2OFrames.
:param H2OFrame y: If this parameter is provided, then compute correlation between the columns of ``y``
and the columns of the current frame. If this parameter is not given, then just compute the correlation
matrix for the columns ... | h2o-py/h2o/frame.py | def cor(self, y=None, na_rm=False, use=None):
"""
Compute the correlation matrix of one or two H2OFrames.
:param H2OFrame y: If this parameter is provided, then compute correlation between the columns of ``y``
and the columns of the current frame. If this parameter is not given, the... | def cor(self, y=None, na_rm=False, use=None):
"""
Compute the correlation matrix of one or two H2OFrames.
:param H2OFrame y: If this parameter is provided, then compute correlation between the columns of ``y``
and the columns of the current frame. If this parameter is not given, the... | [
"Compute",
"the",
"correlation",
"matrix",
"of",
"one",
"or",
"two",
"H2OFrames",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2183-L2211 | [
"def",
"cor",
"(",
"self",
",",
"y",
"=",
"None",
",",
"na_rm",
"=",
"False",
",",
"use",
"=",
"None",
")",
":",
"assert_is_type",
"(",
"y",
",",
"H2OFrame",
",",
"None",
")",
"assert_is_type",
"(",
"na_rm",
",",
"bool",
")",
"assert_is_type",
"(",
... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.distance | Compute a pairwise distance measure between all rows of two numeric H2OFrames.
:param H2OFrame y: Frame containing queries (small)
:param str use: A string indicating what distance measure to use. Must be one of:
- ``"l1"``: Absolute distance (L1-norm, >=0)
- ``"l2"``: ... | h2o-py/h2o/frame.py | def distance(self, y, measure=None):
"""
Compute a pairwise distance measure between all rows of two numeric H2OFrames.
:param H2OFrame y: Frame containing queries (small)
:param str use: A string indicating what distance measure to use. Must be one of:
- ``"l1"``: A... | def distance(self, y, measure=None):
"""
Compute a pairwise distance measure between all rows of two numeric H2OFrames.
:param H2OFrame y: Frame containing queries (small)
:param str use: A string indicating what distance measure to use. Must be one of:
- ``"l1"``: A... | [
"Compute",
"a",
"pairwise",
"distance",
"measure",
"between",
"all",
"rows",
"of",
"two",
"numeric",
"H2OFrames",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2214-L2243 | [
"def",
"distance",
"(",
"self",
",",
"y",
",",
"measure",
"=",
"None",
")",
":",
"assert_is_type",
"(",
"y",
",",
"H2OFrame",
")",
"if",
"measure",
"is",
"None",
":",
"measure",
"=",
"\"l2\"",
"return",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"Ex... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.strdistance | Compute element-wise string distances between two H2OFrames. Both frames need to have the same
shape and only contain string/factor columns.
:param H2OFrame y: A comparison frame.
:param str measure: A string identifier indicating what string distance measure to use. Must be one of:
... | h2o-py/h2o/frame.py | def strdistance(self, y, measure=None, compare_empty=True):
"""
Compute element-wise string distances between two H2OFrames. Both frames need to have the same
shape and only contain string/factor columns.
:param H2OFrame y: A comparison frame.
:param str measure: A string identi... | def strdistance(self, y, measure=None, compare_empty=True):
"""
Compute element-wise string distances between two H2OFrames. Both frames need to have the same
shape and only contain string/factor columns.
:param H2OFrame y: A comparison frame.
:param str measure: A string identi... | [
"Compute",
"element",
"-",
"wise",
"string",
"distances",
"between",
"two",
"H2OFrames",
".",
"Both",
"frames",
"need",
"to",
"have",
"the",
"same",
"shape",
"and",
"only",
"contain",
"string",
"/",
"factor",
"columns",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2246-L2275 | [
"def",
"strdistance",
"(",
"self",
",",
"y",
",",
"measure",
"=",
"None",
",",
"compare_empty",
"=",
"True",
")",
":",
"assert_is_type",
"(",
"y",
",",
"H2OFrame",
")",
"assert_is_type",
"(",
"measure",
",",
"Enum",
"(",
"'lv'",
",",
"'lcs'",
",",
"'qg... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.asfactor | Convert columns in the current frame to categoricals.
:returns: new H2OFrame with columns of the "enum" type. | h2o-py/h2o/frame.py | def asfactor(self):
"""
Convert columns in the current frame to categoricals.
:returns: new H2OFrame with columns of the "enum" type.
"""
for colname in self.names:
t = self.types[colname]
if t not in {"bool", "int", "string", "enum"}:
rai... | def asfactor(self):
"""
Convert columns in the current frame to categoricals.
:returns: new H2OFrame with columns of the "enum" type.
"""
for colname in self.names:
t = self.types[colname]
if t not in {"bool", "int", "string", "enum"}:
rai... | [
"Convert",
"columns",
"in",
"the",
"current",
"frame",
"to",
"categoricals",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2278-L2295 | [
"def",
"asfactor",
"(",
"self",
")",
":",
"for",
"colname",
"in",
"self",
".",
"names",
":",
"t",
"=",
"self",
".",
"types",
"[",
"colname",
"]",
"if",
"t",
"not",
"in",
"{",
"\"bool\"",
",",
"\"int\"",
",",
"\"string\"",
",",
"\"enum\"",
"}",
":",... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.categories | Return the list of levels for an enum (categorical) column.
This function can only be applied to single-column categorical frame. | h2o-py/h2o/frame.py | def categories(self):
"""
Return the list of levels for an enum (categorical) column.
This function can only be applied to single-column categorical frame.
"""
if self.ncols != 1:
raise H2OValueError("This operation only applies to a single factor column")
if... | def categories(self):
"""
Return the list of levels for an enum (categorical) column.
This function can only be applied to single-column categorical frame.
"""
if self.ncols != 1:
raise H2OValueError("This operation only applies to a single factor column")
if... | [
"Return",
"the",
"list",
"of",
"levels",
"for",
"an",
"enum",
"(",
"categorical",
")",
"column",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2312-L2322 | [
"def",
"categories",
"(",
"self",
")",
":",
"if",
"self",
".",
"ncols",
"!=",
"1",
":",
"raise",
"H2OValueError",
"(",
"\"This operation only applies to a single factor column\"",
")",
"if",
"self",
".",
"types",
"[",
"self",
".",
"names",
"[",
"0",
"]",
"]"... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.strsplit | Split the strings in the target column on the given regular expression pattern.
:param str pattern: The split pattern.
:returns: H2OFrame containing columns of the split strings. | h2o-py/h2o/frame.py | def strsplit(self, pattern):
"""
Split the strings in the target column on the given regular expression pattern.
:param str pattern: The split pattern.
:returns: H2OFrame containing columns of the split strings.
"""
fr = H2OFrame._expr(expr=ExprNode("strsplit", self, pat... | def strsplit(self, pattern):
"""
Split the strings in the target column on the given regular expression pattern.
:param str pattern: The split pattern.
:returns: H2OFrame containing columns of the split strings.
"""
fr = H2OFrame._expr(expr=ExprNode("strsplit", self, pat... | [
"Split",
"the",
"strings",
"in",
"the",
"target",
"column",
"on",
"the",
"given",
"regular",
"expression",
"pattern",
"."
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2334-L2343 | [
"def",
"strsplit",
"(",
"self",
",",
"pattern",
")",
":",
"fr",
"=",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"strsplit\"",
",",
"self",
",",
"pattern",
")",
")",
"fr",
".",
"_ex",
".",
"_cache",
".",
"nrows",
"=",
"self",
"."... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.tokenize | Tokenize String
tokenize() is similar to strsplit(), the difference between them is that tokenize() will store the tokenized
text into a single column making it easier for additional processing (filtering stop words, word2vec algo, ...).
:param str split The regular expression to split on.
... | h2o-py/h2o/frame.py | def tokenize(self, split):
"""
Tokenize String
tokenize() is similar to strsplit(), the difference between them is that tokenize() will store the tokenized
text into a single column making it easier for additional processing (filtering stop words, word2vec algo, ...).
:param st... | def tokenize(self, split):
"""
Tokenize String
tokenize() is similar to strsplit(), the difference between them is that tokenize() will store the tokenized
text into a single column making it easier for additional processing (filtering stop words, word2vec algo, ...).
:param st... | [
"Tokenize",
"String"
] | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2345-L2356 | [
"def",
"tokenize",
"(",
"self",
",",
"split",
")",
":",
"fr",
"=",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"tokenize\"",
",",
"self",
",",
"split",
")",
")",
"return",
"fr"
] | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
test | H2OFrame.countmatches | For each string in the frame, count the occurrences of the provided pattern. If countmathces is applied to
a frame, all columns of the frame must be type string, otherwise, the returned frame will contain errors.
The pattern here is a plain string, not a regular expression. We will search for the occu... | h2o-py/h2o/frame.py | def countmatches(self, pattern):
"""
For each string in the frame, count the occurrences of the provided pattern. If countmathces is applied to
a frame, all columns of the frame must be type string, otherwise, the returned frame will contain errors.
The pattern here is a plain string, ... | def countmatches(self, pattern):
"""
For each string in the frame, count the occurrences of the provided pattern. If countmathces is applied to
a frame, all columns of the frame must be type string, otherwise, the returned frame will contain errors.
The pattern here is a plain string, ... | [
"For",
"each",
"string",
"in",
"the",
"frame",
"count",
"the",
"occurrences",
"of",
"the",
"provided",
"pattern",
".",
"If",
"countmathces",
"is",
"applied",
"to",
"a",
"frame",
"all",
"columns",
"of",
"the",
"frame",
"must",
"be",
"type",
"string",
"other... | h2oai/h2o-3 | python | https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/frame.py#L2358-L2376 | [
"def",
"countmatches",
"(",
"self",
",",
"pattern",
")",
":",
"assert_is_type",
"(",
"pattern",
",",
"str",
",",
"[",
"str",
"]",
")",
"fr",
"=",
"H2OFrame",
".",
"_expr",
"(",
"expr",
"=",
"ExprNode",
"(",
"\"countmatches\"",
",",
"self",
",",
"patter... | dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.