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
H2OGridSearch.sort_by
Deprecated since 2016-12-12, use grid.get_grid() instead.
h2o-py/h2o/grid/grid_search.py
def sort_by(self, metric, increasing=True): """Deprecated since 2016-12-12, use grid.get_grid() instead.""" if metric[-1] != ')': metric += '()' c_values = [list(x) for x in zip(*sorted(eval('self.' + metric + '.items()'), key=lambda k_v: k_v[1]))] c_values.insert(1, [self.get_hyperpara...
def sort_by(self, metric, increasing=True): """Deprecated since 2016-12-12, use grid.get_grid() instead.""" if metric[-1] != ')': metric += '()' c_values = [list(x) for x in zip(*sorted(eval('self.' + metric + '.items()'), key=lambda k_v: k_v[1]))] c_values.insert(1, [self.get_hyperpara...
[ "Deprecated", "since", "2016", "-", "12", "-", "12", "use", "grid", ".", "get_grid", "()", "instead", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/grid/grid_search.py#L812-L824
[ "def", "sort_by", "(", "self", ",", "metric", ",", "increasing", "=", "True", ")", ":", "if", "metric", "[", "-", "1", "]", "!=", "')'", ":", "metric", "+=", "'()'", "c_values", "=", "[", "list", "(", "x", ")", "for", "x", "in", "zip", "(", "*"...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OAutoEncoderGridSearch.anomaly
Obtain the reconstruction error for the input test_data. :param H2OFrame test_data: The dataset upon which the reconstruction error is computed. :param bool per_feature: Whether to return the square reconstruction error per feature. Otherwise, return the mean square error. :returns:...
h2o-py/h2o/grid/metrics.py
def anomaly(self, test_data, per_feature=False): """ Obtain the reconstruction error for the input test_data. :param H2OFrame test_data: The dataset upon which the reconstruction error is computed. :param bool per_feature: Whether to return the square reconstruction error per feature. O...
def anomaly(self, test_data, per_feature=False): """ Obtain the reconstruction error for the input test_data. :param H2OFrame test_data: The dataset upon which the reconstruction error is computed. :param bool per_feature: Whether to return the square reconstruction error per feature. O...
[ "Obtain", "the", "reconstruction", "error", "for", "the", "input", "test_data", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/grid/metrics.py#L11-L20
[ "def", "anomaly", "(", "self", ",", "test_data", ",", "per_feature", "=", "False", ")", ":", "return", "{", "model", ".", "model_id", ":", "model", ".", "anomaly", "(", "test_data", ",", "per_feature", ")", "for", "model", "in", "self", ".", "models", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OBinomialGridSearch.F1
Get the F1 values for a set of thresholds for the models explored. If all are False (default), then return the training metric value. If more than one options is set to True, then return a dictionary of metrics where the keys are "train", "valid", and "xval". :param List thresholds: If...
h2o-py/h2o/grid/metrics.py
def F1(self, thresholds=None, train=False, valid=False, xval=False): """ Get the F1 values for a set of thresholds for the models explored. If all are False (default), then return the training metric value. If more than one options is set to True, then return a dictionary of metrics whe...
def F1(self, thresholds=None, train=False, valid=False, xval=False): """ Get the F1 values for a set of thresholds for the models explored. If all are False (default), then return the training metric value. If more than one options is set to True, then return a dictionary of metrics whe...
[ "Get", "the", "F1", "values", "for", "a", "set", "of", "thresholds", "for", "the", "models", "explored", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/grid/metrics.py#L30-L45
[ "def", "F1", "(", "self", ",", "thresholds", "=", "None", ",", "train", "=", "False", ",", "valid", "=", "False", ",", "xval", "=", "False", ")", ":", "return", "{", "model", ".", "model_id", ":", "model", ".", "F1", "(", "thresholds", ",", "train"...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OBinomialGridSearch.confusion_matrix
Get the confusion matrix for the specified metrics/thresholds. If all are False (default), then return the training metric value. If more than one options is set to True, then return a dictionary of metrics where the keys are "train", "valid", and "xval". :param metrics: A list of metr...
h2o-py/h2o/grid/metrics.py
def confusion_matrix(self, metrics=None, thresholds=None, train=False, valid=False, xval=False): """ Get the confusion matrix for the specified metrics/thresholds. If all are False (default), then return the training metric value. If more than one options is set to True, then return a d...
def confusion_matrix(self, metrics=None, thresholds=None, train=False, valid=False, xval=False): """ Get the confusion matrix for the specified metrics/thresholds. If all are False (default), then return the training metric value. If more than one options is set to True, then return a d...
[ "Get", "the", "confusion", "matrix", "for", "the", "specified", "metrics", "/", "thresholds", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/grid/metrics.py#L388-L407
[ "def", "confusion_matrix", "(", "self", ",", "metrics", "=", "None", ",", "thresholds", "=", "None", ",", "train", "=", "False", ",", "valid", "=", "False", ",", "xval", "=", "False", ")", ":", "return", "{", "model", ".", "model_id", ":", "model", "...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OBinomialGridSearch.find_idx_by_threshold
Retrieve the index in this metric's threshold list at which the given threshold is located. If all are False (default), then return the training metric value. If more than one options is set to True, then return a dictionary of metrics where the keys are "train", "valid", and "xval". :...
h2o-py/h2o/grid/metrics.py
def find_idx_by_threshold(self, threshold, train=False, valid=False, xval=False): """ Retrieve the index in this metric's threshold list at which the given threshold is located. If all are False (default), then return the training metric value. If more than one options is set to True, t...
def find_idx_by_threshold(self, threshold, train=False, valid=False, xval=False): """ Retrieve the index in this metric's threshold list at which the given threshold is located. If all are False (default), then return the training metric value. If more than one options is set to True, t...
[ "Retrieve", "the", "index", "in", "this", "metric", "s", "threshold", "list", "at", "which", "the", "given", "threshold", "is", "located", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/grid/metrics.py#L425-L439
[ "def", "find_idx_by_threshold", "(", "self", ",", "threshold", ",", "train", "=", "False", ",", "valid", "=", "False", ",", "xval", "=", "False", ")", ":", "return", "{", "model", ".", "model_id", ":", "model", ".", "find_idx_by_threshold", "(", "threshold...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OMultinomialGridSearch.confusion_matrix
Returns a confusion matrix based of H2O's default prediction threshold for a dataset. :param data: metric for which the confusion matrix will be calculated.
h2o-py/h2o/grid/metrics.py
def confusion_matrix(self, data): """ Returns a confusion matrix based of H2O's default prediction threshold for a dataset. :param data: metric for which the confusion matrix will be calculated. """ return {model.model_id: model.confusion_matrix(data) for model in self.models}
def confusion_matrix(self, data): """ Returns a confusion matrix based of H2O's default prediction threshold for a dataset. :param data: metric for which the confusion matrix will be calculated. """ return {model.model_id: model.confusion_matrix(data) for model in self.models}
[ "Returns", "a", "confusion", "matrix", "based", "of", "H2O", "s", "default", "prediction", "threshold", "for", "a", "dataset", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/grid/metrics.py#L609-L615
[ "def", "confusion_matrix", "(", "self", ",", "data", ")", ":", "return", "{", "model", ".", "model_id", ":", "model", ".", "confusion_matrix", "(", "data", ")", "for", "model", "in", "self", ".", "models", "}" ]
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2ODimReductionModel.varimp
Return the Importance of components associcated with a pca model. use_pandas: ``bool`` (default: ``False``).
h2o-py/h2o/model/dim_reduction.py
def varimp(self, use_pandas=False): """ Return the Importance of components associcated with a pca model. use_pandas: ``bool`` (default: ``False``). """ model = self._model_json["output"] if "importance" in list(model.keys()) and model["importance"]: vals = ...
def varimp(self, use_pandas=False): """ Return the Importance of components associcated with a pca model. use_pandas: ``bool`` (default: ``False``). """ model = self._model_json["output"] if "importance" in list(model.keys()) and model["importance"]: vals = ...
[ "Return", "the", "Importance", "of", "components", "associcated", "with", "a", "pca", "model", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/dim_reduction.py#L17-L33
[ "def", "varimp", "(", "self", ",", "use_pandas", "=", "False", ")", ":", "model", "=", "self", ".", "_model_json", "[", "\"output\"", "]", "if", "\"importance\"", "in", "list", "(", "model", ".", "keys", "(", ")", ")", "and", "model", "[", "\"importanc...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2ODimReductionModel.archetypes
The archetypes (Y) of the GLRM model.
h2o-py/h2o/model/dim_reduction.py
def archetypes(self): """The archetypes (Y) of the GLRM model.""" o = self._model_json["output"] yvals = o["archetypes"].cell_values archetypes = [] for yidx, yval in enumerate(yvals): archetypes.append(list(yvals[yidx])[1:]) return archetypes
def archetypes(self): """The archetypes (Y) of the GLRM model.""" o = self._model_json["output"] yvals = o["archetypes"].cell_values archetypes = [] for yidx, yval in enumerate(yvals): archetypes.append(list(yvals[yidx])[1:]) return archetypes
[ "The", "archetypes", "(", "Y", ")", "of", "the", "GLRM", "model", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/dim_reduction.py#L53-L60
[ "def", "archetypes", "(", "self", ")", ":", "o", "=", "self", ".", "_model_json", "[", "\"output\"", "]", "yvals", "=", "o", "[", "\"archetypes\"", "]", ".", "cell_values", "archetypes", "=", "[", "]", "for", "yidx", ",", "yval", "in", "enumerate", "("...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2ODimReductionModel.proj_archetypes
Convert archetypes of the model into original feature space. :param H2OFrame test_data: The dataset upon which the model was trained. :param bool reverse_transform: Whether the transformation of the training data during model-building should be reversed on the projected archetypes. ...
h2o-py/h2o/model/dim_reduction.py
def proj_archetypes(self, test_data, reverse_transform=False): """ Convert archetypes of the model into original feature space. :param H2OFrame test_data: The dataset upon which the model was trained. :param bool reverse_transform: Whether the transformation of the training data during ...
def proj_archetypes(self, test_data, reverse_transform=False): """ Convert archetypes of the model into original feature space. :param H2OFrame test_data: The dataset upon which the model was trained. :param bool reverse_transform: Whether the transformation of the training data during ...
[ "Convert", "archetypes", "of", "the", "model", "into", "original", "feature", "space", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/dim_reduction.py#L79-L92
[ "def", "proj_archetypes", "(", "self", ",", "test_data", ",", "reverse_transform", "=", "False", ")", ":", "if", "test_data", "is", "None", "or", "test_data", ".", "nrow", "==", "0", ":", "raise", "ValueError", "(", "\"Must specify test data\"", ")", "j", "=...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2ODimReductionModel.screeplot
Produce the scree plot. Library ``matplotlib`` is required for this function. :param str type: either ``"barplot"`` or ``"lines"``.
h2o-py/h2o/model/dim_reduction.py
def screeplot(self, type="barplot", **kwargs): """ Produce the scree plot. Library ``matplotlib`` is required for this function. :param str type: either ``"barplot"`` or ``"lines"``. """ # check for matplotlib. exit if absent. is_server = kwargs.pop("server") ...
def screeplot(self, type="barplot", **kwargs): """ Produce the scree plot. Library ``matplotlib`` is required for this function. :param str type: either ``"barplot"`` or ``"lines"``. """ # check for matplotlib. exit if absent. is_server = kwargs.pop("server") ...
[ "Produce", "the", "scree", "plot", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/dim_reduction.py#L95-L124
[ "def", "screeplot", "(", "self", ",", "type", "=", "\"barplot\"", ",", "*", "*", "kwargs", ")", ":", "# check for matplotlib. exit if absent.", "is_server", "=", "kwargs", ".", "pop", "(", "\"server\"", ")", "if", "kwargs", ":", "raise", "ValueError", "(", "...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
translate_name
Convert names with underscores into camelcase. For example: "num_rows" => "numRows" "very_long_json_name" => "veryLongJsonName" "build_GBM_model" => "buildGbmModel" "KEY" => "key" "middle___underscores" => "middleUnderscores" "_exclude_fields" => "_excludeFields" (re...
h2o-bindings/bin/gen_java.py
def translate_name(name): """ Convert names with underscores into camelcase. For example: "num_rows" => "numRows" "very_long_json_name" => "veryLongJsonName" "build_GBM_model" => "buildGbmModel" "KEY" => "key" "middle___underscores" => "middleUnderscores" "_e...
def translate_name(name): """ Convert names with underscores into camelcase. For example: "num_rows" => "numRows" "very_long_json_name" => "veryLongJsonName" "build_GBM_model" => "buildGbmModel" "KEY" => "key" "middle___underscores" => "middleUnderscores" "_e...
[ "Convert", "names", "with", "underscores", "into", "camelcase", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-bindings/bin/gen_java.py#L42-L69
[ "def", "translate_name", "(", "name", ")", ":", "parts", "=", "name", ".", "split", "(", "\"_\"", ")", "i", "=", "0", "while", "parts", "[", "i", "]", "==", "\"\"", ":", "parts", "[", "i", "]", "=", "\"_\"", "i", "+=", "1", "parts", "[", "i", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
dedent
Dedent text to the specific indentation level. :param ind: common indentation level for the resulting text (number of spaces to append to every line) :param text: text that should be transformed. :return: ``text`` with all common indentation removed, and then the specified amount of indentation added.
h2o-bindings/bin/gen_java.py
def dedent(ind, text): """ Dedent text to the specific indentation level. :param ind: common indentation level for the resulting text (number of spaces to append to every line) :param text: text that should be transformed. :return: ``text`` with all common indentation removed, and then the specifie...
def dedent(ind, text): """ Dedent text to the specific indentation level. :param ind: common indentation level for the resulting text (number of spaces to append to every line) :param text: text that should be transformed. :return: ``text`` with all common indentation removed, and then the specifie...
[ "Dedent", "text", "to", "the", "specific", "indentation", "level", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-bindings/bin/gen_java.py#L71-L83
[ "def", "dedent", "(", "ind", ",", "text", ")", ":", "text2", "=", "textwrap", ".", "dedent", "(", "text", ")", "if", "ind", "==", "0", ":", "return", "text2", "indent_str", "=", "\" \"", "*", "ind", "return", "\"\\n\"", ".", "join", "(", "indent_str"...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
generate_schema
Generate schema Java class. :param class_name: name of the class :param schema: information about the class
h2o-bindings/bin/gen_java.py
def generate_schema(class_name, schema): """ Generate schema Java class. :param class_name: name of the class :param schema: information about the class """ superclass = schema["superclass"] if superclass == "Schema": superclass = "Object" has_map = False is_model_builder = False ...
def generate_schema(class_name, schema): """ Generate schema Java class. :param class_name: name of the class :param schema: information about the class """ superclass = schema["superclass"] if superclass == "Schema": superclass = "Object" has_map = False is_model_builder = False ...
[ "Generate", "schema", "Java", "class", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-bindings/bin/gen_java.py#L91-L186
[ "def", "generate_schema", "(", "class_name", ",", "schema", ")", ":", "superclass", "=", "schema", "[", "\"superclass\"", "]", "if", "superclass", "==", "\"Schema\"", ":", "superclass", "=", "\"Object\"", "has_map", "=", "False", "is_model_builder", "=", "False"...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
generate_proxy
Generate a Retrofit Proxy class. Retrofit interfaces look like this: public interface GitHubService { @GET("/users/{user}/repos") Call<List<Repo>> listRepos(@Path("user") String user); } :param classname: name of the class :param endpoints: list of endpoints serv...
h2o-bindings/bin/gen_java.py
def generate_proxy(classname, endpoints): """ Generate a Retrofit Proxy class. Retrofit interfaces look like this: public interface GitHubService { @GET("/users/{user}/repos") Call<List<Repo>> listRepos(@Path("user") String user); } :param classname: name of th...
def generate_proxy(classname, endpoints): """ Generate a Retrofit Proxy class. Retrofit interfaces look like this: public interface GitHubService { @GET("/users/{user}/repos") Call<List<Repo>> listRepos(@Path("user") String user); } :param classname: name of th...
[ "Generate", "a", "Retrofit", "Proxy", "class", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-bindings/bin/gen_java.py#L213-L336
[ "def", "generate_proxy", "(", "classname", ",", "endpoints", ")", ":", "# Replace path vars like (?<schemaname>.*) with {schemaname} for Retrofit's annotation", "var_pattern", "=", "re", ".", "compile", "(", "r\"\\{(\\w+)\\}\"", ")", "helper_class", "=", "[", "]", "found_ke...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
main
Main program. @return: none
h2o-r/scripts/build_dataset_from_parse_log.py
def main(argv): """ Main program. @return: none """ global g_script_name global g_parse_log_path g_script_name = os.path.basename(argv[0]) parse_args(argv) if (g_parse_log_path is None): print("") print("ERROR: -f not specified") usage() d = Dataset(g...
def main(argv): """ Main program. @return: none """ global g_script_name global g_parse_log_path g_script_name = os.path.basename(argv[0]) parse_args(argv) if (g_parse_log_path is None): print("") print("ERROR: -f not specified") usage() d = Dataset(g...
[ "Main", "program", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-r/scripts/build_dataset_from_parse_log.py#L298-L321
[ "def", "main", "(", "argv", ")", ":", "global", "g_script_name", "global", "g_parse_log_path", "g_script_name", "=", "os", ".", "path", ".", "basename", "(", "argv", "[", "0", "]", ")", "parse_args", "(", "argv", ")", "if", "(", "g_parse_log_path", "is", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
Dataset.parse
Parse file specified by constructor.
h2o-r/scripts/build_dataset_from_parse_log.py
def parse(self): """ Parse file specified by constructor. """ f = open(self.parse_log_path, "r") self.parse2(f) f.close()
def parse(self): """ Parse file specified by constructor. """ f = open(self.parse_log_path, "r") self.parse2(f) f.close()
[ "Parse", "file", "specified", "by", "constructor", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-r/scripts/build_dataset_from_parse_log.py#L100-L106
[ "def", "parse", "(", "self", ")", ":", "f", "=", "open", "(", "self", ".", "parse_log_path", ",", "\"r\"", ")", "self", ".", "parse2", "(", "f", ")", "f", ".", "close", "(", ")" ]
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
Dataset.parse2
Parse file specified by constructor.
h2o-r/scripts/build_dataset_from_parse_log.py
def parse2(self, f): """ Parse file specified by constructor. """ line_num = 0 s = f.readline() while (len(s) > 0): line_num += 1 # Check for beginning of parsed data set. match_groups = re.search(r"Parse result for (.*) .(\d+) rows.:"...
def parse2(self, f): """ Parse file specified by constructor. """ line_num = 0 s = f.readline() while (len(s) > 0): line_num += 1 # Check for beginning of parsed data set. match_groups = re.search(r"Parse result for (.*) .(\d+) rows.:"...
[ "Parse", "file", "specified", "by", "constructor", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-r/scripts/build_dataset_from_parse_log.py#L108-L208
[ "def", "parse2", "(", "self", ",", "f", ")", ":", "line_num", "=", "0", "s", "=", "f", ".", "readline", "(", ")", "while", "(", "len", "(", "s", ")", ">", "0", ")", ":", "line_num", "+=", "1", "# Check for beginning of parsed data set.", "match_groups"...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OAutoEncoderModel.anomaly
Obtain the reconstruction error for the input test_data. :param H2OFrame test_data: The dataset upon which the reconstruction error is computed. :param bool per_feature: Whether to return the square reconstruction error per feature. Otherwise, return the mean square error. :returns...
h2o-py/h2o/model/autoencoder.py
def anomaly(self, test_data, per_feature=False): """ Obtain the reconstruction error for the input test_data. :param H2OFrame test_data: The dataset upon which the reconstruction error is computed. :param bool per_feature: Whether to return the square reconstruction error per feature. ...
def anomaly(self, test_data, per_feature=False): """ Obtain the reconstruction error for the input test_data. :param H2OFrame test_data: The dataset upon which the reconstruction error is computed. :param bool per_feature: Whether to return the square reconstruction error per feature. ...
[ "Obtain", "the", "reconstruction", "error", "for", "the", "input", "test_data", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/autoencoder.py#L11-L24
[ "def", "anomaly", "(", "self", ",", "test_data", ",", "per_feature", "=", "False", ")", ":", "if", "test_data", "is", "None", "or", "test_data", ".", "nrow", "==", "0", ":", "raise", "ValueError", "(", "\"Must specify test data\"", ")", "j", "=", "h2o", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
extractRunInto
This function will extract the various operation time for GLRM model building iterations. :param javaLogText: :return:
scripts/extractGLRMRuntimeJavaLog.py
def extractRunInto(javaLogText): """ This function will extract the various operation time for GLRM model building iterations. :param javaLogText: :return: """ global g_initialXY global g_reguarlize_Y global g_regularize_X_objective global g_updateX global g_updateY global g...
def extractRunInto(javaLogText): """ This function will extract the various operation time for GLRM model building iterations. :param javaLogText: :return: """ global g_initialXY global g_reguarlize_Y global g_regularize_X_objective global g_updateX global g_updateY global g...
[ "This", "function", "will", "extract", "the", "various", "operation", "time", "for", "GLRM", "model", "building", "iterations", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/extractGLRMRuntimeJavaLog.py#L31-L112
[ "def", "extractRunInto", "(", "javaLogText", ")", ":", "global", "g_initialXY", "global", "g_reguarlize_Y", "global", "g_regularize_X_objective", "global", "g_updateX", "global", "g_updateY", "global", "g_objective", "global", "g_stepsize", "global", "g_history", "if", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
main
Main program. Take user input, parse it and call other functions to execute the commands and extract run summary and store run result in json file @return: none
scripts/extractGLRMRuntimeJavaLog.py
def main(argv): """ Main program. Take user input, parse it and call other functions to execute the commands and extract run summary and store run result in json file @return: none """ global g_test_root_dir global g_temp_filename if len(argv) < 2: print("invoke this script as...
def main(argv): """ Main program. Take user input, parse it and call other functions to execute the commands and extract run summary and store run result in json file @return: none """ global g_test_root_dir global g_temp_filename if len(argv) < 2: print("invoke this script as...
[ "Main", "program", ".", "Take", "user", "input", "parse", "it", "and", "call", "other", "functions", "to", "execute", "the", "commands", "and", "extract", "run", "summary", "and", "store", "run", "result", "in", "json", "file" ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/extractGLRMRuntimeJavaLog.py#L115-L132
[ "def", "main", "(", "argv", ")", ":", "global", "g_test_root_dir", "global", "g_temp_filename", "if", "len", "(", "argv", ")", "<", "2", ":", "print", "(", "\"invoke this script as python extractGLRMRuntimeJavaLog.py javatextlog.\\n\"", ")", "sys", ".", "exit", "(",...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
NumpyDocString._parse_see_also
func_name : Descriptive text continued text another_func_name : Descriptive text func_name1, func_name2, :meth:`func_name`, func_name3
h2o-docs/src/product/sphinxext/docscrape.py
def _parse_see_also(self, content): """ func_name : Descriptive text continued text another_func_name : Descriptive text func_name1, func_name2, :meth:`func_name`, func_name3 """ items = [] def parse_item_name(text): """Match ':role:`name...
def _parse_see_also(self, content): """ func_name : Descriptive text continued text another_func_name : Descriptive text func_name1, func_name2, :meth:`func_name`, func_name3 """ items = [] def parse_item_name(text): """Match ':role:`name...
[ "func_name", ":", "Descriptive", "text", "continued", "text", "another_func_name", ":", "Descriptive", "text", "func_name1", "func_name2", ":", "meth", ":", "func_name", "func_name3" ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-docs/src/product/sphinxext/docscrape.py#L189-L241
[ "def", "_parse_see_also", "(", "self", ",", "content", ")", ":", "items", "=", "[", "]", "def", "parse_item_name", "(", "text", ")", ":", "\"\"\"Match ':role:`name`' or 'name'\"\"\"", "m", "=", "self", ".", "_name_rgx", ".", "match", "(", "text", ")", "if", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
NumpyDocString._parse_index
.. index: default :refguide: something, else, and more
h2o-docs/src/product/sphinxext/docscrape.py
def _parse_index(self, section, content): """ .. index: default :refguide: something, else, and more """ def strip_each_in(lst): return [s.strip() for s in lst] out = {} section = section.split('::') if len(section) > 1: out['d...
def _parse_index(self, section, content): """ .. index: default :refguide: something, else, and more """ def strip_each_in(lst): return [s.strip() for s in lst] out = {} section = section.split('::') if len(section) > 1: out['d...
[ "..", "index", ":", "default", ":", "refguide", ":", "something", "else", "and", "more" ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-docs/src/product/sphinxext/docscrape.py#L243-L260
[ "def", "_parse_index", "(", "self", ",", "section", ",", "content", ")", ":", "def", "strip_each_in", "(", "lst", ")", ":", "return", "[", "s", ".", "strip", "(", ")", "for", "s", "in", "lst", "]", "out", "=", "{", "}", "section", "=", "section", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OConnectionConf._fill_from_config
Fill this instance from given dictionary. The method only uses keys which corresponds to properties this class, throws exception on unknown property name. :param conf: dictionary of parameters :return: a new instance of this class filled with values from given dictionary :raise...
h2o-py/h2o/backend/connection.py
def _fill_from_config(self, config): """ Fill this instance from given dictionary. The method only uses keys which corresponds to properties this class, throws exception on unknown property name. :param conf: dictionary of parameters :return: a new instance of this clas...
def _fill_from_config(self, config): """ Fill this instance from given dictionary. The method only uses keys which corresponds to properties this class, throws exception on unknown property name. :param conf: dictionary of parameters :return: a new instance of this clas...
[ "Fill", "this", "instance", "from", "given", "dictionary", ".", "The", "method", "only", "uses", "keys", "which", "corresponds", "to", "properties", "this", "class", "throws", "exception", "on", "unknown", "property", "name", ".", ":", "param", "conf", ":", ...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/backend/connection.py#L74-L87
[ "def", "_fill_from_config", "(", "self", ",", "config", ")", ":", "for", "k", ",", "v", "in", "config", ".", "items", "(", ")", ":", "if", "k", "in", "H2OConnectionConf", ".", "allowed_properties", ":", "setattr", "(", "self", ",", "k", ",", "v", ")"...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OConnection.open
r""" Establish connection to an existing H2O server. The connection is not kept alive, so what this method actually does is it attempts to connect to the specified server, and checks that the server is healthy and responds to REST API requests. If the H2O server cannot be reached, an :c...
h2o-py/h2o/backend/connection.py
def open(server=None, url=None, ip=None, port=None, name=None, https=None, auth=None, verify_ssl_certificates=True, proxy=None, cookies=None, verbose=True, _msgs=None): r""" Establish connection to an existing H2O server. The connection is not kept alive, so what this method actual...
def open(server=None, url=None, ip=None, port=None, name=None, https=None, auth=None, verify_ssl_certificates=True, proxy=None, cookies=None, verbose=True, _msgs=None): r""" Establish connection to an existing H2O server. The connection is not kept alive, so what this method actual...
[ "r", "Establish", "connection", "to", "an", "existing", "H2O", "server", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/backend/connection.py#L212-L335
[ "def", "open", "(", "server", "=", "None", ",", "url", "=", "None", ",", "ip", "=", "None", ",", "port", "=", "None", ",", "name", "=", "None", ",", "https", "=", "None", ",", "auth", "=", "None", ",", "verify_ssl_certificates", "=", "True", ",", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OConnection.request
Perform a REST API request to the backend H2O server. :param endpoint: (str) The endpoint's URL, for example "GET /4/schemas/KeyV4" :param data: data payload for POST (and sometimes GET) requests. This should be a dictionary of simple key/value pairs (values can also be arrays), which will ...
h2o-py/h2o/backend/connection.py
def request(self, endpoint, data=None, json=None, filename=None, save_to=None): """ Perform a REST API request to the backend H2O server. :param endpoint: (str) The endpoint's URL, for example "GET /4/schemas/KeyV4" :param data: data payload for POST (and sometimes GET) requests. This s...
def request(self, endpoint, data=None, json=None, filename=None, save_to=None): """ Perform a REST API request to the backend H2O server. :param endpoint: (str) The endpoint's URL, for example "GET /4/schemas/KeyV4" :param data: data payload for POST (and sometimes GET) requests. This s...
[ "Perform", "a", "REST", "API", "request", "to", "the", "backend", "H2O", "server", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/backend/connection.py#L338-L424
[ "def", "request", "(", "self", ",", "endpoint", ",", "data", "=", "None", ",", "json", "=", "None", ",", "filename", "=", "None", ",", "save_to", "=", "None", ")", ":", "if", "self", ".", "_stage", "==", "0", ":", "raise", "H2OConnectionError", "(", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OConnection.close
Close an existing connection; once closed it cannot be used again. Strictly speaking it is not necessary to close all connection that you opened -- we have several mechanisms in place that will do so automatically (__del__(), __exit__() and atexit() handlers), however there is also no good reas...
h2o-py/h2o/backend/connection.py
def close(self): """ Close an existing connection; once closed it cannot be used again. Strictly speaking it is not necessary to close all connection that you opened -- we have several mechanisms in place that will do so automatically (__del__(), __exit__() and atexit() handlers), howev...
def close(self): """ Close an existing connection; once closed it cannot be used again. Strictly speaking it is not necessary to close all connection that you opened -- we have several mechanisms in place that will do so automatically (__del__(), __exit__() and atexit() handlers), howev...
[ "Close", "an", "existing", "connection", ";", "once", "closed", "it", "cannot", "be", "used", "again", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/backend/connection.py#L427-L444
[ "def", "close", "(", "self", ")", ":", "if", "self", ".", "_session_id", ":", "try", ":", "# If the server gone bad, we don't want to wait forever...", "if", "self", ".", "_timeout", "is", "None", ":", "self", ".", "_timeout", "=", "1", "self", ".", "request",...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OConnection.session_id
Return the session id of the current connection. The session id is issued (through an API request) the first time it is requested, but no sooner. This is because generating a session id puts it into the DKV on the server, which effectively locks the cluster. Once issued, the session id will sta...
h2o-py/h2o/backend/connection.py
def session_id(self): """ Return the session id of the current connection. The session id is issued (through an API request) the first time it is requested, but no sooner. This is because generating a session id puts it into the DKV on the server, which effectively locks the cluster. On...
def session_id(self): """ Return the session id of the current connection. The session id is issued (through an API request) the first time it is requested, but no sooner. This is because generating a session id puts it into the DKV on the server, which effectively locks the cluster. On...
[ "Return", "the", "session", "id", "of", "the", "current", "connection", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/backend/connection.py#L448-L459
[ "def", "session_id", "(", "self", ")", ":", "if", "self", ".", "_session_id", "is", "None", ":", "req", "=", "self", ".", "request", "(", "\"POST /4/sessions\"", ")", "self", ".", "_session_id", "=", "req", ".", "get", "(", "\"session_key\"", ")", "or", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OConnection.start_logging
Start logging all API requests to the provided destination. :param dest: Where to write the log: either a filename (str), or an open file handle (file). If not given, then a new temporary file will be created.
h2o-py/h2o/backend/connection.py
def start_logging(self, dest=None): """ Start logging all API requests to the provided destination. :param dest: Where to write the log: either a filename (str), or an open file handle (file). If not given, then a new temporary file will be created. """ assert_is_typ...
def start_logging(self, dest=None): """ Start logging all API requests to the provided destination. :param dest: Where to write the log: either a filename (str), or an open file handle (file). If not given, then a new temporary file will be created. """ assert_is_typ...
[ "Start", "logging", "all", "API", "requests", "to", "the", "provided", "destination", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/backend/connection.py#L503-L515
[ "def", "start_logging", "(", "self", ",", "dest", "=", "None", ")", ":", "assert_is_type", "(", "dest", ",", "None", ",", "str", ",", "type", "(", "sys", ".", "stdout", ")", ")", "if", "dest", "is", "None", ":", "dest", "=", "os", ".", "path", "....
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OConnection._prepare_data_payload
Make a copy of the `data` object, preparing it to be sent to the server. The data will be sent via x-www-form-urlencoded or multipart/form-data mechanisms. Both of them work with plain lists of key/value pairs, so this method converts the data into such format.
h2o-py/h2o/backend/connection.py
def _prepare_data_payload(data): """ Make a copy of the `data` object, preparing it to be sent to the server. The data will be sent via x-www-form-urlencoded or multipart/form-data mechanisms. Both of them work with plain lists of key/value pairs, so this method converts the data into s...
def _prepare_data_payload(data): """ Make a copy of the `data` object, preparing it to be sent to the server. The data will be sent via x-www-form-urlencoded or multipart/form-data mechanisms. Both of them work with plain lists of key/value pairs, so this method converts the data into s...
[ "Make", "a", "copy", "of", "the", "data", "object", "preparing", "it", "to", "be", "sent", "to", "the", "server", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/backend/connection.py#L607-L628
[ "def", "_prepare_data_payload", "(", "data", ")", ":", "if", "not", "data", ":", "return", "None", "res", "=", "{", "}", "for", "key", ",", "value", "in", "viewitems", "(", "data", ")", ":", "if", "value", "is", "None", ":", "continue", "# don't send a...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OConnection._prepare_file_payload
Prepare `filename` to be sent to the server. The "preparation" consists of creating a data structure suitable for passing to requests.request().
h2o-py/h2o/backend/connection.py
def _prepare_file_payload(filename): """ Prepare `filename` to be sent to the server. The "preparation" consists of creating a data structure suitable for passing to requests.request(). """ if not filename: return None absfilename = os.path.abspath(filename) ...
def _prepare_file_payload(filename): """ Prepare `filename` to be sent to the server. The "preparation" consists of creating a data structure suitable for passing to requests.request(). """ if not filename: return None absfilename = os.path.abspath(filename) ...
[ "Prepare", "filename", "to", "be", "sent", "to", "the", "server", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/backend/connection.py#L632-L643
[ "def", "_prepare_file_payload", "(", "filename", ")", ":", "if", "not", "filename", ":", "return", "None", "absfilename", "=", "os", ".", "path", ".", "abspath", "(", "filename", ")", "if", "not", "os", ".", "path", ".", "exists", "(", "absfilename", ")"...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OConnection._log_start_transaction
Log the beginning of an API request.
h2o-py/h2o/backend/connection.py
def _log_start_transaction(self, endpoint, data, json, files, params): """Log the beginning of an API request.""" # TODO: add information about the caller, i.e. which module + line of code called the .request() method # This can be done by fetching current traceback and then traversing it ...
def _log_start_transaction(self, endpoint, data, json, files, params): """Log the beginning of an API request.""" # TODO: add information about the caller, i.e. which module + line of code called the .request() method # This can be done by fetching current traceback and then traversing it ...
[ "Log", "the", "beginning", "of", "an", "API", "request", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/backend/connection.py#L646-L660
[ "def", "_log_start_transaction", "(", "self", ",", "endpoint", ",", "data", ",", "json", ",", "files", ",", "params", ")", ":", "# TODO: add information about the caller, i.e. which module + line of code called the .request() method", "# This can be done by fetching current t...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OConnection._log_end_transaction
Log response from an API request.
h2o-py/h2o/backend/connection.py
def _log_end_transaction(self, start_time, response): """Log response from an API request.""" if not self._is_logging: return elapsed_time = int((time.time() - start_time) * 1000) msg = "<<< HTTP %d %s (%d ms)\n" % (response.status_code, response.reason, elapsed_time) if "Conte...
def _log_end_transaction(self, start_time, response): """Log response from an API request.""" if not self._is_logging: return elapsed_time = int((time.time() - start_time) * 1000) msg = "<<< HTTP %d %s (%d ms)\n" % (response.status_code, response.reason, elapsed_time) if "Conte...
[ "Log", "response", "from", "an", "API", "request", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/backend/connection.py#L663-L671
[ "def", "_log_end_transaction", "(", "self", ",", "start_time", ",", "response", ")", ":", "if", "not", "self", ".", "_is_logging", ":", "return", "elapsed_time", "=", "int", "(", "(", "time", ".", "time", "(", ")", "-", "start_time", ")", "*", "1000", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OConnection._log_message
Log the message `msg` to the destination `self._logging_dest`. If this destination is a file name, then we append the message to the file and then close the file immediately. If the destination is an open file handle, then we simply write the message there and do not attempt to close it.
h2o-py/h2o/backend/connection.py
def _log_message(self, msg): """ Log the message `msg` to the destination `self._logging_dest`. If this destination is a file name, then we append the message to the file and then close the file immediately. If the destination is an open file handle, then we simply write the message the...
def _log_message(self, msg): """ Log the message `msg` to the destination `self._logging_dest`. If this destination is a file name, then we append the message to the file and then close the file immediately. If the destination is an open file handle, then we simply write the message the...
[ "Log", "the", "message", "msg", "to", "the", "destination", "self", ".", "_logging_dest", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/backend/connection.py#L680-L692
[ "def", "_log_message", "(", "self", ",", "msg", ")", ":", "if", "is_type", "(", "self", ".", "_logging_dest", ",", "str", ")", ":", "with", "open", "(", "self", ".", "_logging_dest", ",", "\"at\"", ",", "encoding", "=", "\"utf-8\"", ")", "as", "f", "...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OConnection._process_response
Given a response object, prepare it to be handed over to the external caller. Preparation steps include: * detect if the response has error status, and convert it to an appropriate exception; * detect Content-Type, and based on that either parse the response as JSON or return as plain tex...
h2o-py/h2o/backend/connection.py
def _process_response(response, save_to): """ Given a response object, prepare it to be handed over to the external caller. Preparation steps include: * detect if the response has error status, and convert it to an appropriate exception; * detect Content-Type, and based on...
def _process_response(response, save_to): """ Given a response object, prepare it to be handed over to the external caller. Preparation steps include: * detect if the response has error status, and convert it to an appropriate exception; * detect Content-Type, and based on...
[ "Given", "a", "response", "object", "prepare", "it", "to", "be", "handed", "over", "to", "the", "external", "caller", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/backend/connection.py#L696-L748
[ "def", "_process_response", "(", "response", ",", "save_to", ")", ":", "status_code", "=", "response", ".", "status_code", "if", "status_code", "==", "200", "and", "save_to", ":", "if", "save_to", ".", "startswith", "(", "\"~\"", ")", ":", "save_to", "=", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OConnection._print
Helper function to print connection status messages when in verbose mode.
h2o-py/h2o/backend/connection.py
def _print(self, msg, flush=False, end="\n"): """Helper function to print connection status messages when in verbose mode.""" if self._verbose: print2(msg, end=end, flush=flush)
def _print(self, msg, flush=False, end="\n"): """Helper function to print connection status messages when in verbose mode.""" if self._verbose: print2(msg, end=end, flush=flush)
[ "Helper", "function", "to", "print", "connection", "status", "messages", "when", "in", "verbose", "mode", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/backend/connection.py#L758-L761
[ "def", "_print", "(", "self", ",", "msg", ",", "flush", "=", "False", ",", "end", "=", "\"\\n\"", ")", ":", "if", "self", ".", "_verbose", ":", "print2", "(", "msg", ",", "end", "=", "end", ",", "flush", "=", "flush", ")" ]
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
approxEqual
approxEqual(float1, float2[, tol=1e-18, rel=1e-7]) -> True|False approxEqual(obj1, obj2[, *args, **kwargs]) -> True|False Return True if x and y are approximately equal, otherwise False. If x and y are floats, return True if y is within either absolute error tol or relative error rel of x. You can dis...
py2/h2o_util.py
def approxEqual(x, y, *args, **kwargs): """approxEqual(float1, float2[, tol=1e-18, rel=1e-7]) -> True|False approxEqual(obj1, obj2[, *args, **kwargs]) -> True|False Return True if x and y are approximately equal, otherwise False. If x and y are floats, return True if y is within either absolute error ...
def approxEqual(x, y, *args, **kwargs): """approxEqual(float1, float2[, tol=1e-18, rel=1e-7]) -> True|False approxEqual(obj1, obj2[, *args, **kwargs]) -> True|False Return True if x and y are approximately equal, otherwise False. If x and y are floats, return True if y is within either absolute error ...
[ "approxEqual", "(", "float1", "float2", "[", "tol", "=", "1e", "-", "18", "rel", "=", "1e", "-", "7", "]", ")", "-", ">", "True|False", "approxEqual", "(", "obj1", "obj2", "[", "*", "args", "**", "kwargs", "]", ")", "-", ">", "True|False" ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/h2o_util.py#L152-L199
[ "def", "approxEqual", "(", "x", ",", "y", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "not", "(", "type", "(", "x", ")", "is", "type", "(", "y", ")", "is", "float", ")", ":", "# Skip checking for __approxEqual__ in the common case of two f...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
json_repr
Represent instance of a class as JSON. Arguments: obj -- any object Return: String that represent JSON-encoded object.
py2/h2o_util.py
def json_repr(obj, curr_depth=0, max_depth=4): """Represent instance of a class as JSON. Arguments: obj -- any object Return: String that represent JSON-encoded object. """ def serialize(obj, curr_depth): """Recursively walk object's hierarchy. Limit to max_depth""" if curr_d...
def json_repr(obj, curr_depth=0, max_depth=4): """Represent instance of a class as JSON. Arguments: obj -- any object Return: String that represent JSON-encoded object. """ def serialize(obj, curr_depth): """Recursively walk object's hierarchy. Limit to max_depth""" if curr_d...
[ "Represent", "instance", "of", "a", "class", "as", "JSON", ".", "Arguments", ":", "obj", "--", "any", "object", "Return", ":", "String", "that", "represent", "JSON", "-", "encoded", "object", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/h2o_util.py#L708-L735
[ "def", "json_repr", "(", "obj", ",", "curr_depth", "=", "0", ",", "max_depth", "=", "4", ")", ":", "def", "serialize", "(", "obj", ",", "curr_depth", ")", ":", "\"\"\"Recursively walk object's hierarchy. Limit to max_depth\"\"\"", "if", "curr_depth", ">", "max_dep...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
get_automl
Retrieve information about an AutoML instance. :param str project_name: A string indicating the project_name of the automl instance to retrieve. :returns: A dictionary containing the project_name, leader model, and leaderboard.
h2o-py/h2o/automl/autoh2o.py
def get_automl(project_name): """ Retrieve information about an AutoML instance. :param str project_name: A string indicating the project_name of the automl instance to retrieve. :returns: A dictionary containing the project_name, leader model, and leaderboard. """ automl_json = h2o.api("GET /...
def get_automl(project_name): """ Retrieve information about an AutoML instance. :param str project_name: A string indicating the project_name of the automl instance to retrieve. :returns: A dictionary containing the project_name, leader model, and leaderboard. """ automl_json = h2o.api("GET /...
[ "Retrieve", "information", "about", "an", "AutoML", "instance", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/automl/autoh2o.py#L503-L537
[ "def", "get_automl", "(", "project_name", ")", ":", "automl_json", "=", "h2o", ".", "api", "(", "\"GET /99/AutoML/%s\"", "%", "project_name", ")", "project_name", "=", "automl_json", "[", "\"project_name\"", "]", "leaderboard_list", "=", "[", "key", "[", "\"name...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OAutoML.train
Begins an AutoML task, a background task that automatically builds a number of models with various algorithms and tracks their performance in a leaderboard. At any point in the process you may use H2O's performance or prediction functions on the resulting models. :param x: A list of c...
h2o-py/h2o/automl/autoh2o.py
def train(self, x = None, y = None, training_frame = None, fold_column = None, weights_column = None, validation_frame = None, leaderboard_frame = None, blending_frame = None): """ Begins an AutoML task, a background task that automatically builds a number of models with various a...
def train(self, x = None, y = None, training_frame = None, fold_column = None, weights_column = None, validation_frame = None, leaderboard_frame = None, blending_frame = None): """ Begins an AutoML task, a background task that automatically builds a number of models with various a...
[ "Begins", "an", "AutoML", "task", "a", "background", "task", "that", "automatically", "builds", "a", "number", "of", "models", "with", "various", "algorithms", "and", "tracks", "their", "performance", "in", "a", "leaderboard", ".", "At", "any", "point", "in", ...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/automl/autoh2o.py#L281-L412
[ "def", "train", "(", "self", ",", "x", "=", "None", ",", "y", "=", "None", ",", "training_frame", "=", "None", ",", "fold_column", "=", "None", ",", "weights_column", "=", "None", ",", "validation_frame", "=", "None", ",", "leaderboard_frame", "=", "None...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OAutoML.predict
Predict on a dataset. :param H2OFrame test_data: Data on which to make predictions. :returns: A new H2OFrame of predictions. :examples: >>> # Set up an H2OAutoML object >>> aml = H2OAutoML(max_runtime_secs=30) >>> # Launch an H2OAutoML run >>> aml.train(y=y, tr...
h2o-py/h2o/automl/autoh2o.py
def predict(self, test_data): """ Predict on a dataset. :param H2OFrame test_data: Data on which to make predictions. :returns: A new H2OFrame of predictions. :examples: >>> # Set up an H2OAutoML object >>> aml = H2OAutoML(max_runtime_secs=30) >>> # Lau...
def predict(self, test_data): """ Predict on a dataset. :param H2OFrame test_data: Data on which to make predictions. :returns: A new H2OFrame of predictions. :examples: >>> # Set up an H2OAutoML object >>> aml = H2OAutoML(max_runtime_secs=30) >>> # Lau...
[ "Predict", "on", "a", "dataset", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/automl/autoh2o.py#L417-L437
[ "def", "predict", "(", "self", ",", "test_data", ")", ":", "if", "self", ".", "_fetch", "(", ")", ":", "self", ".", "_model", "=", "h2o", ".", "get_model", "(", "self", ".", "_leader_id", ")", "return", "self", ".", "_model", ".", "predict", "(", "...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OAutoML.download_pojo
Download the POJO for the leader model in AutoML to the directory specified by path. If path is an empty string, then dump the output to screen. :param path: An absolute path to the directory where POJO should be saved. :param get_genmodel_jar: if True, then also download h2o-genmodel.jar and...
h2o-py/h2o/automl/autoh2o.py
def download_pojo(self, path="", get_genmodel_jar=False, genmodel_name=""): """ Download the POJO for the leader model in AutoML to the directory specified by path. If path is an empty string, then dump the output to screen. :param path: An absolute path to the directory where POJO sh...
def download_pojo(self, path="", get_genmodel_jar=False, genmodel_name=""): """ Download the POJO for the leader model in AutoML to the directory specified by path. If path is an empty string, then dump the output to screen. :param path: An absolute path to the directory where POJO sh...
[ "Download", "the", "POJO", "for", "the", "leader", "model", "in", "AutoML", "to", "the", "directory", "specified", "by", "path", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/automl/autoh2o.py#L443-L455
[ "def", "download_pojo", "(", "self", ",", "path", "=", "\"\"", ",", "get_genmodel_jar", "=", "False", ",", "genmodel_name", "=", "\"\"", ")", ":", "return", "h2o", ".", "download_pojo", "(", "self", ".", "leader", ",", "path", ",", "get_jar", "=", "get_g...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OAutoML.download_mojo
Download the leader model in AutoML in MOJO format. :param path: the path where MOJO file should be saved. :param get_genmodel_jar: if True, then also download h2o-genmodel.jar and store it in folder ``path``. :param genmodel_name Custom name of genmodel jar :returns: name of the MOJO f...
h2o-py/h2o/automl/autoh2o.py
def download_mojo(self, path=".", get_genmodel_jar=False, genmodel_name=""): """ Download the leader model in AutoML in MOJO format. :param path: the path where MOJO file should be saved. :param get_genmodel_jar: if True, then also download h2o-genmodel.jar and store it in folder ``path...
def download_mojo(self, path=".", get_genmodel_jar=False, genmodel_name=""): """ Download the leader model in AutoML in MOJO format. :param path: the path where MOJO file should be saved. :param get_genmodel_jar: if True, then also download h2o-genmodel.jar and store it in folder ``path...
[ "Download", "the", "leader", "model", "in", "AutoML", "in", "MOJO", "format", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/automl/autoh2o.py#L457-L467
[ "def", "download_mojo", "(", "self", ",", "path", "=", "\".\"", ",", "get_genmodel_jar", "=", "False", ",", "genmodel_name", "=", "\"\"", ")", ":", "return", "ModelBase", ".", "download_mojo", "(", "self", ".", "leader", ",", "path", ",", "get_genmodel_jar",...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OScaler.fit
Fit this object by computing the means and standard deviations used by the transform method. :param X: An H2OFrame; may contain NAs and/or categoricals. :param y: None (Ignored) :param params: Ignored :returns: This H2OScaler instance
h2o-py/h2o/transforms/preprocessing.py
def fit(self, X, y=None, **params): """ Fit this object by computing the means and standard deviations used by the transform method. :param X: An H2OFrame; may contain NAs and/or categoricals. :param y: None (Ignored) :param params: Ignored :returns: This H2OScaler insta...
def fit(self, X, y=None, **params): """ Fit this object by computing the means and standard deviations used by the transform method. :param X: An H2OFrame; may contain NAs and/or categoricals. :param y: None (Ignored) :param params: Ignored :returns: This H2OScaler insta...
[ "Fit", "this", "object", "by", "computing", "the", "means", "and", "standard", "deviations", "used", "by", "the", "transform", "method", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/transforms/preprocessing.py#L44-L63
[ "def", "fit", "(", "self", ",", "X", ",", "y", "=", "None", ",", "*", "*", "params", ")", ":", "if", "isinstance", "(", "self", ".", "parms", "[", "\"center\"", "]", ",", "(", "tuple", ",", "list", ")", ")", ":", "self", ".", "_means", "=", "...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OScaler.transform
Scale an H2OFrame with the fitted means and standard deviations. :param X: An H2OFrame; may contain NAs and/or categoricals. :param y: None (Ignored) :param params: (Ignored) :returns: A scaled H2OFrame.
h2o-py/h2o/transforms/preprocessing.py
def transform(self, X, y=None, **params): """ Scale an H2OFrame with the fitted means and standard deviations. :param X: An H2OFrame; may contain NAs and/or categoricals. :param y: None (Ignored) :param params: (Ignored) :returns: A scaled H2OFrame. """ r...
def transform(self, X, y=None, **params): """ Scale an H2OFrame with the fitted means and standard deviations. :param X: An H2OFrame; may contain NAs and/or categoricals. :param y: None (Ignored) :param params: (Ignored) :returns: A scaled H2OFrame. """ r...
[ "Scale", "an", "H2OFrame", "with", "the", "fitted", "means", "and", "standard", "deviations", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/transforms/preprocessing.py#L66-L75
[ "def", "transform", "(", "self", ",", "X", ",", "y", "=", "None", ",", "*", "*", "params", ")", ":", "return", "X", ".", "scale", "(", "self", ".", "means", ",", "self", ".", "stds", ")" ]
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OScaler.inverse_transform
Undo the scale transformation. :param X: An H2OFrame; may contain NAs and/or categoricals. :param y: None (Ignored) :param params: (Ignored) :returns: An H2OFrame
h2o-py/h2o/transforms/preprocessing.py
def inverse_transform(self, X, y=None, **params): """ Undo the scale transformation. :param X: An H2OFrame; may contain NAs and/or categoricals. :param y: None (Ignored) :param params: (Ignored) :returns: An H2OFrame """ for i in range(X.ncol): ...
def inverse_transform(self, X, y=None, **params): """ Undo the scale transformation. :param X: An H2OFrame; may contain NAs and/or categoricals. :param y: None (Ignored) :param params: (Ignored) :returns: An H2OFrame """ for i in range(X.ncol): ...
[ "Undo", "the", "scale", "transformation", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/transforms/preprocessing.py#L78-L89
[ "def", "inverse_transform", "(", "self", ",", "X", ",", "y", "=", "None", ",", "*", "*", "params", ")", ":", "for", "i", "in", "range", "(", "X", ".", "ncol", ")", ":", "X", "[", "i", "]", "=", "self", ".", "means", "[", "i", "]", "+", "sel...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
main
Main program. @return: none
scripts/recent_changes.py
def main(argv): """ Main program. @return: none """ global g_script_name g_script_name = os.path.basename(argv[0]) parse_config_file() parse_args(argv) url = 'https://0xdata.atlassian.net/rest/api/2/search?jql=' \ + 'project+in+(PUBDEV,HEXDEV)' \ + '+and+' \ ...
def main(argv): """ Main program. @return: none """ global g_script_name g_script_name = os.path.basename(argv[0]) parse_config_file() parse_args(argv) url = 'https://0xdata.atlassian.net/rest/api/2/search?jql=' \ + 'project+in+(PUBDEV,HEXDEV)' \ + '+and+' \ ...
[ "Main", "program", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/recent_changes.py#L126-L171
[ "def", "main", "(", "argv", ")", ":", "global", "g_script_name", "g_script_name", "=", "os", ".", "path", ".", "basename", "(", "argv", "[", "0", "]", ")", "parse_config_file", "(", ")", "parse_args", "(", "argv", ")", "url", "=", "'https://0xdata.atlassia...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
extract_true_string
remove extra characters before the actual string we are looking for. The Jenkins console output is encoded using utf-8. However, the stupid redirect function can only encode using ASCII. I have googled for half a day with no results to how to resolve the issue. Hence, we are going to the heat and just m...
scripts/logscrapedaily.py
def extract_true_string(string_content): """ remove extra characters before the actual string we are looking for. The Jenkins console output is encoded using utf-8. However, the stupid redirect function can only encode using ASCII. I have googled for half a day with no results to how to resolve t...
def extract_true_string(string_content): """ remove extra characters before the actual string we are looking for. The Jenkins console output is encoded using utf-8. However, the stupid redirect function can only encode using ASCII. I have googled for half a day with no results to how to resolve t...
[ "remove", "extra", "characters", "before", "the", "actual", "string", "we", "are", "looking", "for", ".", "The", "Jenkins", "console", "output", "is", "encoded", "using", "utf", "-", "8", ".", "However", "the", "stupid", "redirect", "function", "can", "only"...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/logscrapedaily.py#L118-L141
[ "def", "extract_true_string", "(", "string_content", ")", ":", "startL", ",", "found", ",", "endL", "=", "string_content", ".", "partition", "(", "'[0m'", ")", "if", "found", ":", "return", "endL", "else", ":", "return", "string_content" ]
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
find_time
calculate the approximate date/time from the timestamp about when the job was built. This information was then saved in dict g_failed_test_info_dict. In addition, it will delete this particular function handle off the temp_func_list as we do not need to perform this action again. Parameters ------...
scripts/logscrapedaily.py
def find_time(each_line,temp_func_list): """ calculate the approximate date/time from the timestamp about when the job was built. This information was then saved in dict g_failed_test_info_dict. In addition, it will delete this particular function handle off the temp_func_list as we do not need to ...
def find_time(each_line,temp_func_list): """ calculate the approximate date/time from the timestamp about when the job was built. This information was then saved in dict g_failed_test_info_dict. In addition, it will delete this particular function handle off the temp_func_list as we do not need to ...
[ "calculate", "the", "approximate", "date", "/", "time", "from", "the", "timestamp", "about", "when", "the", "job", "was", "built", ".", "This", "information", "was", "then", "saved", "in", "dict", "g_failed_test_info_dict", ".", "In", "addition", "it", "will",...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/logscrapedaily.py#L146-L175
[ "def", "find_time", "(", "each_line", ",", "temp_func_list", ")", ":", "global", "g_weekdays", "global", "g_months", "global", "g_failed_test_info_dict", "temp_strings", "=", "each_line", ".", "strip", "(", ")", ".", "split", "(", ")", "if", "(", "len", "(", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
find_node_name
Find the slave machine where a Jenkins job was executed on. It will save this information in g_failed_test_info_dict. In addition, it will delete this particular function handle off the temp_func_list as we do not need to perform this action again. Parameters ---------- each_line : str ...
scripts/logscrapedaily.py
def find_node_name(each_line,temp_func_list): """ Find the slave machine where a Jenkins job was executed on. It will save this information in g_failed_test_info_dict. In addition, it will delete this particular function handle off the temp_func_list as we do not need to perform this action again....
def find_node_name(each_line,temp_func_list): """ Find the slave machine where a Jenkins job was executed on. It will save this information in g_failed_test_info_dict. In addition, it will delete this particular function handle off the temp_func_list as we do not need to perform this action again....
[ "Find", "the", "slave", "machine", "where", "a", "Jenkins", "job", "was", "executed", "on", ".", "It", "will", "save", "this", "information", "in", "g_failed_test_info_dict", ".", "In", "addition", "it", "will", "delete", "this", "particular", "function", "han...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/logscrapedaily.py#L178-L208
[ "def", "find_node_name", "(", "each_line", ",", "temp_func_list", ")", ":", "global", "g_node_name", "global", "g_failed_test_info_dict", "if", "g_node_name", "in", "each_line", ":", "temp_strings", "=", "each_line", ".", "split", "(", ")", "[", "start", ",", "f...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
find_git_hash_branch
Find the git hash and branch info that a Jenkins job was taken from. It will save this information in g_failed_test_info_dict. In addition, it will delete this particular function handle off the temp_func_list as we do not need to perform this action again. Parameters ---------- each_line : st...
scripts/logscrapedaily.py
def find_git_hash_branch(each_line,temp_func_list): """ Find the git hash and branch info that a Jenkins job was taken from. It will save this information in g_failed_test_info_dict. In addition, it will delete this particular function handle off the temp_func_list as we do not need to perform this a...
def find_git_hash_branch(each_line,temp_func_list): """ Find the git hash and branch info that a Jenkins job was taken from. It will save this information in g_failed_test_info_dict. In addition, it will delete this particular function handle off the temp_func_list as we do not need to perform this a...
[ "Find", "the", "git", "hash", "and", "branch", "info", "that", "a", "Jenkins", "job", "was", "taken", "from", ".", "It", "will", "save", "this", "information", "in", "g_failed_test_info_dict", ".", "In", "addition", "it", "will", "delete", "this", "particula...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/logscrapedaily.py#L211-L241
[ "def", "find_git_hash_branch", "(", "each_line", ",", "temp_func_list", ")", ":", "global", "g_git_hash_branch", "global", "g_failed_test_info_dict", "if", "g_git_hash_branch", "in", "each_line", ":", "[", "start", ",", "found", ",", "endstr", "]", "=", "each_line",...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
find_build_timeout
Find if a Jenkins job has taken too long to finish and was killed. It will save this information in g_failed_test_info_dict. Parameters ---------- each_line : str contains a line read in from jenkins console temp_func_list : list of Python function handles contains a list of fun...
scripts/logscrapedaily.py
def find_build_timeout(each_line,temp_func_list): """ Find if a Jenkins job has taken too long to finish and was killed. It will save this information in g_failed_test_info_dict. Parameters ---------- each_line : str contains a line read in from jenkins console temp_func_list : ...
def find_build_timeout(each_line,temp_func_list): """ Find if a Jenkins job has taken too long to finish and was killed. It will save this information in g_failed_test_info_dict. Parameters ---------- each_line : str contains a line read in from jenkins console temp_func_list : ...
[ "Find", "if", "a", "Jenkins", "job", "has", "taken", "too", "long", "to", "finish", "and", "was", "killed", ".", "It", "will", "save", "this", "information", "in", "g_failed_test_info_dict", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/logscrapedaily.py#L244-L269
[ "def", "find_build_timeout", "(", "each_line", ",", "temp_func_list", ")", ":", "global", "g_build_timeout", "global", "g_failed_test_info_dict", "global", "g_failure_occurred", "if", "g_build_timeout", "in", "each_line", ":", "g_failed_test_info_dict", "[", "\"8.build_time...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
find_build_failure
Find if a Jenkins job has failed to build. It will save this information in g_failed_test_info_dict. In addition, it will delete this particular function handle off the temp_func_list as we do not need to perform this action again. Parameters ---------- each_line : str contains a line r...
scripts/logscrapedaily.py
def find_build_failure(each_line,temp_func_list): """ Find if a Jenkins job has failed to build. It will save this information in g_failed_test_info_dict. In addition, it will delete this particular function handle off the temp_func_list as we do not need to perform this action again. Parameters ...
def find_build_failure(each_line,temp_func_list): """ Find if a Jenkins job has failed to build. It will save this information in g_failed_test_info_dict. In addition, it will delete this particular function handle off the temp_func_list as we do not need to perform this action again. Parameters ...
[ "Find", "if", "a", "Jenkins", "job", "has", "failed", "to", "build", ".", "It", "will", "save", "this", "information", "in", "g_failed_test_info_dict", ".", "In", "addition", "it", "will", "delete", "this", "particular", "function", "handle", "off", "the", "...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/logscrapedaily.py#L271-L304
[ "def", "find_build_failure", "(", "each_line", ",", "temp_func_list", ")", ":", "global", "g_build_success", "global", "g_build_success_tests", "global", "g_failed_test_info_dict", "global", "g_failure_occurred", "global", "g_build_failed_message", "for", "ind", "in", "rang...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
find_java_filename
Find if all the java_*_0.out.txt files that were mentioned in the console output. It will save this information in g_java_filenames as a list of strings. Parameters ---------- each_line : str contains a line read in from jenkins console temp_func_list : list of Python function handles ...
scripts/logscrapedaily.py
def find_java_filename(each_line,temp_func_list): """ Find if all the java_*_0.out.txt files that were mentioned in the console output. It will save this information in g_java_filenames as a list of strings. Parameters ---------- each_line : str contains a line read in from jenkins co...
def find_java_filename(each_line,temp_func_list): """ Find if all the java_*_0.out.txt files that were mentioned in the console output. It will save this information in g_java_filenames as a list of strings. Parameters ---------- each_line : str contains a line read in from jenkins co...
[ "Find", "if", "all", "the", "java_", "*", "_0", ".", "out", ".", "txt", "files", "that", "were", "mentioned", "in", "the", "console", "output", ".", "It", "will", "save", "this", "information", "in", "g_java_filenames", "as", "a", "list", "of", "strings"...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/logscrapedaily.py#L307-L334
[ "def", "find_java_filename", "(", "each_line", ",", "temp_func_list", ")", ":", "global", "g_before_java_file", "global", "g_java_filenames", "for", "each_word", "in", "g_before_java_file", ":", "if", "(", "each_word", "not", "in", "each_line", ")", ":", "return", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
find_build_id
Find the build id of a jenkins job. It will save this information in g_failed_test_info_dict. In addition, it will delete this particular function handle off the temp_func_list as we do not need to perform this action again. Parameters ---------- each_line : str contains a line read in ...
scripts/logscrapedaily.py
def find_build_id(each_line,temp_func_list): """ Find the build id of a jenkins job. It will save this information in g_failed_test_info_dict. In addition, it will delete this particular function handle off the temp_func_list as we do not need to perform this action again. Parameters --------...
def find_build_id(each_line,temp_func_list): """ Find the build id of a jenkins job. It will save this information in g_failed_test_info_dict. In addition, it will delete this particular function handle off the temp_func_list as we do not need to perform this action again. Parameters --------...
[ "Find", "the", "build", "id", "of", "a", "jenkins", "job", ".", "It", "will", "save", "this", "information", "in", "g_failed_test_info_dict", ".", "In", "addition", "it", "will", "delete", "this", "particular", "function", "handle", "off", "the", "temp_func_li...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/logscrapedaily.py#L337-L370
[ "def", "find_build_id", "(", "each_line", ",", "temp_func_list", ")", ":", "global", "g_before_java_file", "global", "g_java_filenames", "global", "g_build_id_text", "global", "g_jenkins_url", "global", "g_output_filename", "global", "g_output_pickle_filename", "if", "g_bui...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
extract_job_build_url
From user input, grab the jenkins job name and saved it in g_failed_test_info_dict. In addition, it will grab the jenkins url and the view name into g_jenkins_url, and g_view_name. Parameters ---------- url_string : str contains information on the jenkins job whose console output we are in...
scripts/logscrapedaily.py
def extract_job_build_url(url_string): """ From user input, grab the jenkins job name and saved it in g_failed_test_info_dict. In addition, it will grab the jenkins url and the view name into g_jenkins_url, and g_view_name. Parameters ---------- url_string : str contains informatio...
def extract_job_build_url(url_string): """ From user input, grab the jenkins job name and saved it in g_failed_test_info_dict. In addition, it will grab the jenkins url and the view name into g_jenkins_url, and g_view_name. Parameters ---------- url_string : str contains informatio...
[ "From", "user", "input", "grab", "the", "jenkins", "job", "name", "and", "saved", "it", "in", "g_failed_test_info_dict", ".", "In", "addition", "it", "will", "grab", "the", "jenkins", "url", "and", "the", "view", "name", "into", "g_jenkins_url", "and", "g_vi...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/logscrapedaily.py#L487-L513
[ "def", "extract_job_build_url", "(", "url_string", ")", ":", "global", "g_failed_test_info_dict", "global", "g_jenkins_url", "global", "g_view_name", "tempString", "=", "url_string", ".", "strip", "(", "'/'", ")", ".", "split", "(", "'/'", ")", "if", "len", "(",...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
grab_java_message
scan through the java output text and extract the bad java messages that may or may not happened when unit tests are run. It will not record any bad java messages that are stored in g_ok_java_messages. :return: none
scripts/logscrapedaily.py
def grab_java_message(): """scan through the java output text and extract the bad java messages that may or may not happened when unit tests are run. It will not record any bad java messages that are stored in g_ok_java_messages. :return: none """ global g_temp_filename global g_current_testn...
def grab_java_message(): """scan through the java output text and extract the bad java messages that may or may not happened when unit tests are run. It will not record any bad java messages that are stored in g_ok_java_messages. :return: none """ global g_temp_filename global g_current_testn...
[ "scan", "through", "the", "java", "output", "text", "and", "extract", "the", "bad", "java", "messages", "that", "may", "or", "may", "not", "happened", "when", "unit", "tests", "are", "run", ".", "It", "will", "not", "record", "any", "bad", "java", "messa...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/logscrapedaily.py#L516-L589
[ "def", "grab_java_message", "(", ")", ":", "global", "g_temp_filename", "global", "g_current_testname", "global", "g_java_start_text", "global", "g_ok_java_messages", "global", "g_java_general_bad_messages", "# store bad java messages not associated with running a unit test", "global...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
addJavaMessages
Insert Java messages into java_messages and java_message_types if they are associated with a unit test or into g_java_general_bad_messages/g_java_general_bad_message_types otherwise. Parameters ---------- tempMessage : str contains the bad java messages messageType : str conta...
scripts/logscrapedaily.py
def addJavaMessages(tempMessage,messageType,java_messages,java_message_types): """ Insert Java messages into java_messages and java_message_types if they are associated with a unit test or into g_java_general_bad_messages/g_java_general_bad_message_types otherwise. Parameters ---------- tem...
def addJavaMessages(tempMessage,messageType,java_messages,java_message_types): """ Insert Java messages into java_messages and java_message_types if they are associated with a unit test or into g_java_general_bad_messages/g_java_general_bad_message_types otherwise. Parameters ---------- tem...
[ "Insert", "Java", "messages", "into", "java_messages", "and", "java_message_types", "if", "they", "are", "associated", "with", "a", "unit", "test", "or", "into", "g_java_general_bad_messages", "/", "g_java_general_bad_message_types", "otherwise", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/logscrapedaily.py#L592-L633
[ "def", "addJavaMessages", "(", "tempMessage", ",", "messageType", ",", "java_messages", ",", "java_message_types", ")", ":", "global", "g_current_testname", "global", "g_java_general_bad_messages", "global", "g_java_general_bad_message_types", "global", "g_failure_occurred", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
extract_java_messages
loop through java_*_0.out.txt and extract potentially dangerous WARN/ERRR/FATAL messages associated with a test. The test may even pass but something terrible has actually happened. :return: none
scripts/logscrapedaily.py
def extract_java_messages(): """ loop through java_*_0.out.txt and extract potentially dangerous WARN/ERRR/FATAL messages associated with a test. The test may even pass but something terrible has actually happened. :return: none """ global g_jenkins_url global g_failed_test_info_dict ...
def extract_java_messages(): """ loop through java_*_0.out.txt and extract potentially dangerous WARN/ERRR/FATAL messages associated with a test. The test may even pass but something terrible has actually happened. :return: none """ global g_jenkins_url global g_failed_test_info_dict ...
[ "loop", "through", "java_", "*", "_0", ".", "out", ".", "txt", "and", "extract", "potentially", "dangerous", "WARN", "/", "ERRR", "/", "FATAL", "messages", "associated", "with", "a", "test", ".", "The", "test", "may", "even", "pass", "but", "something", ...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/logscrapedaily.py#L674-L718
[ "def", "extract_java_messages", "(", ")", ":", "global", "g_jenkins_url", "global", "g_failed_test_info_dict", "global", "g_java_filenames", "global", "g_failed_jobs", "# record job names of failed jobs", "global", "g_failed_job_java_messages", "# record failed job java message", "...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
save_dict
Save the log scraping results into logs denoted by g_output_filename_failed_tests and g_output_filename_passed_tests. :return: none
scripts/logscrapedaily.py
def save_dict(): """ Save the log scraping results into logs denoted by g_output_filename_failed_tests and g_output_filename_passed_tests. :return: none """ global g_test_root_dir global g_output_filename_failed_tests global g_output_filename_passed_tests global g_output_pickle_fil...
def save_dict(): """ Save the log scraping results into logs denoted by g_output_filename_failed_tests and g_output_filename_passed_tests. :return: none """ global g_test_root_dir global g_output_filename_failed_tests global g_output_filename_passed_tests global g_output_pickle_fil...
[ "Save", "the", "log", "scraping", "results", "into", "logs", "denoted", "by", "g_output_filename_failed_tests", "and", "g_output_filename_passed_tests", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/logscrapedaily.py#L722-L783
[ "def", "save_dict", "(", ")", ":", "global", "g_test_root_dir", "global", "g_output_filename_failed_tests", "global", "g_output_filename_passed_tests", "global", "g_output_pickle_filename", "global", "g_failed_test_info_dict", "# some build can fail really early that no buid id info is...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
write_general_build_message
Write key/value into log file when the value is a string and not a list. Parameters ---------- key : str key value in g_failed_test_info_dict value : str corresponding value associated with the key in key text_file : file handle file handle of log file to write the info to...
scripts/logscrapedaily.py
def write_general_build_message(key,val,text_file): """ Write key/value into log file when the value is a string and not a list. Parameters ---------- key : str key value in g_failed_test_info_dict value : str corresponding value associated with the key in key text_file : ...
def write_general_build_message(key,val,text_file): """ Write key/value into log file when the value is a string and not a list. Parameters ---------- key : str key value in g_failed_test_info_dict value : str corresponding value associated with the key in key text_file : ...
[ "Write", "key", "/", "value", "into", "log", "file", "when", "the", "value", "is", "a", "string", "and", "not", "a", "list", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/logscrapedaily.py#L785-L803
[ "def", "write_general_build_message", "(", "key", ",", "val", ",", "text_file", ")", ":", "text_file", ".", "write", "(", "key", "+", "\": \"", ")", "text_file", ".", "write", "(", "val", ")", "text_file", ".", "write", "(", "'\\n\\n'", ")" ]
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
update_summary_file
Concatecate all log file into a summary text file to be sent to users at the end of a daily log scraping. :return: none
scripts/logscrapedaily.py
def update_summary_file(): """ Concatecate all log file into a summary text file to be sent to users at the end of a daily log scraping. :return: none """ global g_summary_text_filename global g_output_filename_failed_tests global g_output_filename_passed_tests with open(g_summary_...
def update_summary_file(): """ Concatecate all log file into a summary text file to be sent to users at the end of a daily log scraping. :return: none """ global g_summary_text_filename global g_output_filename_failed_tests global g_output_filename_passed_tests with open(g_summary_...
[ "Concatecate", "all", "log", "file", "into", "a", "summary", "text", "file", "to", "be", "sent", "to", "users", "at", "the", "end", "of", "a", "daily", "log", "scraping", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/logscrapedaily.py#L845-L858
[ "def", "update_summary_file", "(", ")", ":", "global", "g_summary_text_filename", "global", "g_output_filename_failed_tests", "global", "g_output_filename_passed_tests", "with", "open", "(", "g_summary_text_filename", ",", "'a'", ")", "as", "tempfile", ":", "write_file_cont...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
write_file_content
Write one log file into the summary text file. Parameters ---------- fhandle : Python file handle file handle to the summary text file file2read : Python file handle file handle to log file where we want to add its content to the summary text file. :return: none
scripts/logscrapedaily.py
def write_file_content(fhandle,file2read): """ Write one log file into the summary text file. Parameters ---------- fhandle : Python file handle file handle to the summary text file file2read : Python file handle file handle to log file where we want to add its content to the s...
def write_file_content(fhandle,file2read): """ Write one log file into the summary text file. Parameters ---------- fhandle : Python file handle file handle to the summary text file file2read : Python file handle file handle to log file where we want to add its content to the s...
[ "Write", "one", "log", "file", "into", "the", "summary", "text", "file", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/logscrapedaily.py#L861-L881
[ "def", "write_file_content", "(", "fhandle", ",", "file2read", ")", ":", "if", "os", ".", "path", ".", "isfile", "(", "file2read", ")", ":", "# write summary of failed tests logs", "with", "open", "(", "file2read", ",", "'r'", ")", "as", "tfile", ":", "fhand...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
write_java_message
Loop through all java messages that are not associated with a unit test and write them into a log file. Parameters ---------- key : str 9.general_bad_java_messages val : list of list of str contains the bad java messages and the message types. :return: none
scripts/logscrapedaily.py
def write_java_message(key,val,text_file): """ Loop through all java messages that are not associated with a unit test and write them into a log file. Parameters ---------- key : str 9.general_bad_java_messages val : list of list of str contains the bad java messages and th...
def write_java_message(key,val,text_file): """ Loop through all java messages that are not associated with a unit test and write them into a log file. Parameters ---------- key : str 9.general_bad_java_messages val : list of list of str contains the bad java messages and th...
[ "Loop", "through", "all", "java", "messages", "that", "are", "not", "associated", "with", "a", "unit", "test", "and", "write", "them", "into", "a", "log", "file", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/logscrapedaily.py#L885-L916
[ "def", "write_java_message", "(", "key", ",", "val", ",", "text_file", ")", ":", "text_file", ".", "write", "(", "key", ")", "text_file", ".", "write", "(", "'\\n'", ")", "if", "(", "len", "(", "val", "[", "0", "]", ")", ">", "0", ")", "and", "("...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
load_java_messages_to_ignore
Load in pickle file that contains dict structure with bad java messages to ignore per unit test or for all cases. The ignored bad java info is stored in g_ok_java_messages dict. :return:
scripts/logscrapedaily.py
def load_java_messages_to_ignore(): """ Load in pickle file that contains dict structure with bad java messages to ignore per unit test or for all cases. The ignored bad java info is stored in g_ok_java_messages dict. :return: """ global g_ok_java_messages global g_java_message_pickle_file...
def load_java_messages_to_ignore(): """ Load in pickle file that contains dict structure with bad java messages to ignore per unit test or for all cases. The ignored bad java info is stored in g_ok_java_messages dict. :return: """ global g_ok_java_messages global g_java_message_pickle_file...
[ "Load", "in", "pickle", "file", "that", "contains", "dict", "structure", "with", "bad", "java", "messages", "to", "ignore", "per", "unit", "test", "or", "for", "all", "cases", ".", "The", "ignored", "bad", "java", "info", "is", "stored", "in", "g_ok_java_m...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/logscrapedaily.py#L919-L933
[ "def", "load_java_messages_to_ignore", "(", ")", ":", "global", "g_ok_java_messages", "global", "g_java_message_pickle_filename", "if", "os", ".", "path", ".", "isfile", "(", "g_java_message_pickle_filename", ")", ":", "with", "open", "(", "g_java_message_pickle_filename"...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
main
Main program. @return: none
scripts/logscrapedaily.py
def main(argv): """ Main program. @return: none """ global g_script_name global g_test_root_dir global g_temp_filename global g_output_filename_failed_tests global g_output_filename_passed_tests global g_output_pickle_filename global g_failure_occurred global g_failed_te...
def main(argv): """ Main program. @return: none """ global g_script_name global g_test_root_dir global g_temp_filename global g_output_filename_failed_tests global g_output_filename_passed_tests global g_output_pickle_filename global g_failure_occurred global g_failed_te...
[ "Main", "program", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/scripts/logscrapedaily.py#L937-L992
[ "def", "main", "(", "argv", ")", ":", "global", "g_script_name", "global", "g_test_root_dir", "global", "g_temp_filename", "global", "g_output_filename_failed_tests", "global", "g_output_filename_passed_tests", "global", "g_output_pickle_filename", "global", "g_failure_occurred...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
normalize_enum_constant
Return enum constant `s` converted to a canonical snake-case.
h2o-bindings/bin/gen_python.py
def normalize_enum_constant(s): """Return enum constant `s` converted to a canonical snake-case.""" if s.islower(): return s if s.isupper(): return s.lower() return "".join(ch if ch.islower() else "_" + ch.lower() for ch in s).strip("_")
def normalize_enum_constant(s): """Return enum constant `s` converted to a canonical snake-case.""" if s.islower(): return s if s.isupper(): return s.lower() return "".join(ch if ch.islower() else "_" + ch.lower() for ch in s).strip("_")
[ "Return", "enum", "constant", "s", "converted", "to", "a", "canonical", "snake", "-", "case", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-bindings/bin/gen_python.py#L66-L70
[ "def", "normalize_enum_constant", "(", "s", ")", ":", "if", "s", ".", "islower", "(", ")", ":", "return", "s", "if", "s", ".", "isupper", "(", ")", ":", "return", "s", ".", "lower", "(", ")", "return", "\"\"", ".", "join", "(", "ch", "if", "ch", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OWordEmbeddingModel.find_synonyms
Find synonyms using a word2vec model. :param str word: A single word to find synonyms for. :param int count: The first "count" synonyms will be returned. :returns: the approximate reconstruction of the training data.
h2o-py/h2o/model/word_embedding.py
def find_synonyms(self, word, count=20): """ Find synonyms using a word2vec model. :param str word: A single word to find synonyms for. :param int count: The first "count" synonyms will be returned. :returns: the approximate reconstruction of the training data. """ ...
def find_synonyms(self, word, count=20): """ Find synonyms using a word2vec model. :param str word: A single word to find synonyms for. :param int count: The first "count" synonyms will be returned. :returns: the approximate reconstruction of the training data. """ ...
[ "Find", "synonyms", "using", "a", "word2vec", "model", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/word_embedding.py#L17-L27
[ "def", "find_synonyms", "(", "self", ",", "word", ",", "count", "=", "20", ")", ":", "j", "=", "h2o", ".", "api", "(", "\"GET /3/Word2VecSynonyms\"", ",", "data", "=", "{", "'model'", ":", "self", ".", "model_id", ",", "'word'", ":", "word", ",", "'c...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OWordEmbeddingModel.transform
Transform words (or sequences of words) to vectors using a word2vec model. :param str words: An H2OFrame made of a single column containing source words. :param str aggregate_method: Specifies how to aggregate sequences of words. If method is `NONE` then no aggregation is performed and e...
h2o-py/h2o/model/word_embedding.py
def transform(self, words, aggregate_method): """ Transform words (or sequences of words) to vectors using a word2vec model. :param str words: An H2OFrame made of a single column containing source words. :param str aggregate_method: Specifies how to aggregate sequences of words. If meth...
def transform(self, words, aggregate_method): """ Transform words (or sequences of words) to vectors using a word2vec model. :param str words: An H2OFrame made of a single column containing source words. :param str aggregate_method: Specifies how to aggregate sequences of words. If meth...
[ "Transform", "words", "(", "or", "sequences", "of", "words", ")", "to", "vectors", "using", "a", "word2vec", "model", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/word_embedding.py#L29-L43
[ "def", "transform", "(", "self", ",", "words", ",", "aggregate_method", ")", ":", "j", "=", "h2o", ".", "api", "(", "\"GET /3/Word2VecTransform\"", ",", "data", "=", "{", "'model'", ":", "self", ".", "model_id", ",", "'words_frame'", ":", "words", ".", "...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OJob.poll
Wait until the job finishes. This method will continuously query the server about the status of the job, until the job reaches a completion. During this time we will display (in stdout) a progress bar with % completion status.
h2o-py/h2o/job.py
def poll(self, verbose_model_scoring_history = False): """ Wait until the job finishes. This method will continuously query the server about the status of the job, until the job reaches a completion. During this time we will display (in stdout) a progress bar with % completion status. ...
def poll(self, verbose_model_scoring_history = False): """ Wait until the job finishes. This method will continuously query the server about the status of the job, until the job reaches a completion. During this time we will display (in stdout) a progress bar with % completion status. ...
[ "Wait", "until", "the", "job", "finishes", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/job.py#L45-L81
[ "def", "poll", "(", "self", ",", "verbose_model_scoring_history", "=", "False", ")", ":", "try", ":", "hidden", "=", "not", "H2OJob", ".", "__PROGRESS_BAR__", "pb", "=", "ProgressBar", "(", "title", "=", "self", ".", "_job_type", "+", "\" progress\"", ",", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OAssembly.to_pojo
Convert the munging operations performed on H2OFrame into a POJO. :param pojo_name: (str) Name of POJO :param path: (str) path of POJO. :param get_jar: (bool) Whether to also download the h2o-genmodel.jar file needed to compile the POJO :return: None
h2o-py/h2o/assembly.py
def to_pojo(self, pojo_name="", path="", get_jar=True): """ Convert the munging operations performed on H2OFrame into a POJO. :param pojo_name: (str) Name of POJO :param path: (str) path of POJO. :param get_jar: (bool) Whether to also download the h2o-genmodel.jar file needed ...
def to_pojo(self, pojo_name="", path="", get_jar=True): """ Convert the munging operations performed on H2OFrame into a POJO. :param pojo_name: (str) Name of POJO :param path: (str) path of POJO. :param get_jar: (bool) Whether to also download the h2o-genmodel.jar file needed ...
[ "Convert", "the", "munging", "operations", "performed", "on", "H2OFrame", "into", "a", "POJO", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/assembly.py#L95-L117
[ "def", "to_pojo", "(", "self", ",", "pojo_name", "=", "\"\"", ",", "path", "=", "\"\"", ",", "get_jar", "=", "True", ")", ":", "assert_is_type", "(", "pojo_name", ",", "str", ")", "assert_is_type", "(", "path", ",", "str", ")", "assert_is_type", "(", "...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
H2OAssembly.fit
To perform the munging operations on a frame specified in steps on the frame fr. :param fr: H2OFrame where munging operations are to be performed on. :return: H2OFrame after munging operations are completed.
h2o-py/h2o/assembly.py
def fit(self, fr): """ To perform the munging operations on a frame specified in steps on the frame fr. :param fr: H2OFrame where munging operations are to be performed on. :return: H2OFrame after munging operations are completed. """ assert_is_type(fr, H2OFrame) ...
def fit(self, fr): """ To perform the munging operations on a frame specified in steps on the frame fr. :param fr: H2OFrame where munging operations are to be performed on. :return: H2OFrame after munging operations are completed. """ assert_is_type(fr, H2OFrame) ...
[ "To", "perform", "the", "munging", "operations", "on", "a", "frame", "specified", "in", "steps", "on", "the", "frame", "fr", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/assembly.py#L131-L142
[ "def", "fit", "(", "self", ",", "fr", ")", ":", "assert_is_type", "(", "fr", ",", "H2OFrame", ")", "steps", "=", "\"[%s]\"", "%", "\",\"", ".", "join", "(", "quoted", "(", "step", "[", "1", "]", ".", "to_rest", "(", "step", "[", "0", "]", ")", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
percentileOnSortedList
Find the percentile of a list of values. @parameter N - is a list of values. Note N MUST BE already sorted. @parameter percent - a float value from 0.0 to 1.0. @parameter key - optional key function to compute value from each element of N. @return - the percentile of the values
py2/h2o_summ.py
def percentileOnSortedList(N, percent, key=lambda x:x, interpolate='mean'): # 5 ways of resolving fractional # floor, ceil, funky, linear, mean interpolateChoices = ['floor', 'ceil', 'funky', 'linear', 'mean'] if interpolate not in interpolateChoices: print "Bad choice for interpolate:", interpo...
def percentileOnSortedList(N, percent, key=lambda x:x, interpolate='mean'): # 5 ways of resolving fractional # floor, ceil, funky, linear, mean interpolateChoices = ['floor', 'ceil', 'funky', 'linear', 'mean'] if interpolate not in interpolateChoices: print "Bad choice for interpolate:", interpo...
[ "Find", "the", "percentile", "of", "a", "list", "of", "values", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/py2/h2o_summ.py#L9-L74
[ "def", "percentileOnSortedList", "(", "N", ",", "percent", ",", "key", "=", "lambda", "x", ":", "x", ",", "interpolate", "=", "'mean'", ")", ":", "# 5 ways of resolving fractional", "# floor, ceil, funky, linear, mean", "interpolateChoices", "=", "[", "'floor'", ","...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.params
Get the parameters and the actual/default values only. :returns: A dictionary of parameters used to build this model.
h2o-py/h2o/model/model_base.py
def params(self): """ Get the parameters and the actual/default values only. :returns: A dictionary of parameters used to build this model. """ params = {} for p in self.parms: params[p] = {"default": self.parms[p]["default_value"], "...
def params(self): """ Get the parameters and the actual/default values only. :returns: A dictionary of parameters used to build this model. """ params = {} for p in self.parms: params[p] = {"default": self.parms[p]["default_value"], "...
[ "Get", "the", "parameters", "and", "the", "actual", "/", "default", "values", "only", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L54-L64
[ "def", "params", "(", "self", ")", ":", "params", "=", "{", "}", "for", "p", "in", "self", ".", "parms", ":", "params", "[", "p", "]", "=", "{", "\"default\"", ":", "self", ".", "parms", "[", "p", "]", "[", "\"default_value\"", "]", ",", "\"actua...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.default_params
Dictionary of the default parameters of the model.
h2o-py/h2o/model/model_base.py
def default_params(self): """Dictionary of the default parameters of the model.""" params = {} for p in self.parms: params[p] = self.parms[p]["default_value"] return params
def default_params(self): """Dictionary of the default parameters of the model.""" params = {} for p in self.parms: params[p] = self.parms[p]["default_value"] return params
[ "Dictionary", "of", "the", "default", "parameters", "of", "the", "model", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L68-L73
[ "def", "default_params", "(", "self", ")", ":", "params", "=", "{", "}", "for", "p", "in", "self", ".", "parms", ":", "params", "[", "p", "]", "=", "self", ".", "parms", "[", "p", "]", "[", "\"default_value\"", "]", "return", "params" ]
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.actual_params
Dictionary of actual parameters of the model.
h2o-py/h2o/model/model_base.py
def actual_params(self): """Dictionary of actual parameters of the model.""" params_to_select = {"model_id": "name", "response_column": "column_name", "training_frame": "name", "validation_frame": "name"} params ...
def actual_params(self): """Dictionary of actual parameters of the model.""" params_to_select = {"model_id": "name", "response_column": "column_name", "training_frame": "name", "validation_frame": "name"} params ...
[ "Dictionary", "of", "actual", "parameters", "of", "the", "model", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L77-L89
[ "def", "actual_params", "(", "self", ")", ":", "params_to_select", "=", "{", "\"model_id\"", ":", "\"name\"", ",", "\"response_column\"", ":", "\"column_name\"", ",", "\"training_frame\"", ":", "\"name\"", ",", "\"validation_frame\"", ":", "\"name\"", "}", "params",...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.predict_leaf_node_assignment
Predict on a dataset and return the leaf node assignment (only for tree-based models). :param H2OFrame test_data: Data on which to make predictions. :param Enum type: How to identify the leaf node. Nodes can be either identified by a path from to the root node of the tree to the node or by H2O'...
h2o-py/h2o/model/model_base.py
def predict_leaf_node_assignment(self, test_data, type="Path"): """ Predict on a dataset and return the leaf node assignment (only for tree-based models). :param H2OFrame test_data: Data on which to make predictions. :param Enum type: How to identify the leaf node. Nodes can be either i...
def predict_leaf_node_assignment(self, test_data, type="Path"): """ Predict on a dataset and return the leaf node assignment (only for tree-based models). :param H2OFrame test_data: Data on which to make predictions. :param Enum type: How to identify the leaf node. Nodes can be either i...
[ "Predict", "on", "a", "dataset", "and", "return", "the", "leaf", "node", "assignment", "(", "only", "for", "tree", "-", "based", "models", ")", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L137-L151
[ "def", "predict_leaf_node_assignment", "(", "self", ",", "test_data", ",", "type", "=", "\"Path\"", ")", ":", "if", "not", "isinstance", "(", "test_data", ",", "h2o", ".", "H2OFrame", ")", ":", "raise", "ValueError", "(", "\"test_data must be an instance of H2OFra...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.staged_predict_proba
Predict class probabilities at each stage of an H2O Model (only GBM models). The output structure is analogous to the output of function predict_leaf_node_assignment. For each tree t and class c there will be a column Tt.Cc (eg. T3.C1 for tree 3 and class 1). The value will be the corresponding ...
h2o-py/h2o/model/model_base.py
def staged_predict_proba(self, test_data): """ Predict class probabilities at each stage of an H2O Model (only GBM models). The output structure is analogous to the output of function predict_leaf_node_assignment. For each tree t and class c there will be a column Tt.Cc (eg. T3.C1 for t...
def staged_predict_proba(self, test_data): """ Predict class probabilities at each stage of an H2O Model (only GBM models). The output structure is analogous to the output of function predict_leaf_node_assignment. For each tree t and class c there will be a column Tt.Cc (eg. T3.C1 for t...
[ "Predict", "class", "probabilities", "at", "each", "stage", "of", "an", "H2O", "Model", "(", "only", "GBM", "models", ")", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L153-L169
[ "def", "staged_predict_proba", "(", "self", ",", "test_data", ")", ":", "if", "not", "isinstance", "(", "test_data", ",", "h2o", ".", "H2OFrame", ")", ":", "raise", "ValueError", "(", "\"test_data must be an instance of H2OFrame\"", ")", "j", "=", "h2o", ".", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.predict
Predict on a dataset. :param H2OFrame test_data: Data on which to make predictions. :param custom_metric: custom evaluation function defined as class reference, the class get uploaded into cluster :param custom_metric_func: custom evaluation function reference, e.g, result of upload_cu...
h2o-py/h2o/model/model_base.py
def predict(self, test_data, custom_metric = None, custom_metric_func = None): """ Predict on a dataset. :param H2OFrame test_data: Data on which to make predictions. :param custom_metric: custom evaluation function defined as class reference, the class get uploaded into cluste...
def predict(self, test_data, custom_metric = None, custom_metric_func = None): """ Predict on a dataset. :param H2OFrame test_data: Data on which to make predictions. :param custom_metric: custom evaluation function defined as class reference, the class get uploaded into cluste...
[ "Predict", "on", "a", "dataset", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L192-L212
[ "def", "predict", "(", "self", ",", "test_data", ",", "custom_metric", "=", "None", ",", "custom_metric_func", "=", "None", ")", ":", "# Upload evaluation function into DKV", "if", "custom_metric", ":", "assert_satisfies", "(", "custom_metric_func", ",", "custom_metri...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.get_xval_models
Return a Model object. :param key: If None, return all cross-validated models; otherwise return the model that key points to. :returns: A model or list of models.
h2o-py/h2o/model/model_base.py
def get_xval_models(self, key=None): """ Return a Model object. :param key: If None, return all cross-validated models; otherwise return the model that key points to. :returns: A model or list of models. """ return h2o.get_model(key) if key is not None else [h2o.get_mod...
def get_xval_models(self, key=None): """ Return a Model object. :param key: If None, return all cross-validated models; otherwise return the model that key points to. :returns: A model or list of models. """ return h2o.get_model(key) if key is not None else [h2o.get_mod...
[ "Return", "a", "Model", "object", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L225-L233
[ "def", "get_xval_models", "(", "self", ",", "key", "=", "None", ")", ":", "return", "h2o", ".", "get_model", "(", "key", ")", "if", "key", "is", "not", "None", "else", "[", "h2o", ".", "get_model", "(", "k", ")", "for", "k", "in", "self", ".", "_...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.deepfeatures
Return hidden layer details. :param test_data: Data to create a feature space on :param layer: 0 index hidden layer
h2o-py/h2o/model/model_base.py
def deepfeatures(self, test_data, layer): """ Return hidden layer details. :param test_data: Data to create a feature space on :param layer: 0 index hidden layer """ if test_data is None: raise ValueError("Must specify test data") if str(layer).isdigit(): ...
def deepfeatures(self, test_data, layer): """ Return hidden layer details. :param test_data: Data to create a feature space on :param layer: 0 index hidden layer """ if test_data is None: raise ValueError("Must specify test data") if str(layer).isdigit(): ...
[ "Return", "hidden", "layer", "details", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L246-L261
[ "def", "deepfeatures", "(", "self", ",", "test_data", ",", "layer", ")", ":", "if", "test_data", "is", "None", ":", "raise", "ValueError", "(", "\"Must specify test data\"", ")", "if", "str", "(", "layer", ")", ".", "isdigit", "(", ")", ":", "j", "=", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.weights
Return the frame for the respective weight matrix. :param: matrix_id: an integer, ranging from 0 to number of layers, that specifies the weight matrix to return. :returns: an H2OFrame which represents the weight matrix identified by matrix_id
h2o-py/h2o/model/model_base.py
def weights(self, matrix_id=0): """ Return the frame for the respective weight matrix. :param: matrix_id: an integer, ranging from 0 to number of layers, that specifies the weight matrix to return. :returns: an H2OFrame which represents the weight matrix identified by matrix_id ...
def weights(self, matrix_id=0): """ Return the frame for the respective weight matrix. :param: matrix_id: an integer, ranging from 0 to number of layers, that specifies the weight matrix to return. :returns: an H2OFrame which represents the weight matrix identified by matrix_id ...
[ "Return", "the", "frame", "for", "the", "respective", "weight", "matrix", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L264-L277
[ "def", "weights", "(", "self", ",", "matrix_id", "=", "0", ")", ":", "num_weight_matrices", "=", "len", "(", "self", ".", "_model_json", "[", "\"output\"", "]", "[", "\"weights\"", "]", ")", "if", "matrix_id", "not", "in", "list", "(", "range", "(", "n...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.biases
Return the frame for the respective bias vector. :param: vector_id: an integer, ranging from 0 to number of layers, that specifies the bias vector to return. :returns: an H2OFrame which represents the bias vector identified by vector_id
h2o-py/h2o/model/model_base.py
def biases(self, vector_id=0): """ Return the frame for the respective bias vector. :param: vector_id: an integer, ranging from 0 to number of layers, that specifies the bias vector to return. :returns: an H2OFrame which represents the bias vector identified by vector_id """ ...
def biases(self, vector_id=0): """ Return the frame for the respective bias vector. :param: vector_id: an integer, ranging from 0 to number of layers, that specifies the bias vector to return. :returns: an H2OFrame which represents the bias vector identified by vector_id """ ...
[ "Return", "the", "frame", "for", "the", "respective", "bias", "vector", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L280-L293
[ "def", "biases", "(", "self", ",", "vector_id", "=", "0", ")", ":", "num_bias_vectors", "=", "len", "(", "self", ".", "_model_json", "[", "\"output\"", "]", "[", "\"biases\"", "]", ")", "if", "vector_id", "not", "in", "list", "(", "range", "(", "num_bi...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.model_performance
Generate model metrics for this model on test_data. :param H2OFrame test_data: Data set for which model metrics shall be computed against. All three of train, valid and xval arguments are ignored if test_data is not None. :param bool train: Report the training metrics for the model. ...
h2o-py/h2o/model/model_base.py
def model_performance(self, test_data=None, train=False, valid=False, xval=False): """ Generate model metrics for this model on test_data. :param H2OFrame test_data: Data set for which model metrics shall be computed against. All three of train, valid and xval arguments are ignored ...
def model_performance(self, test_data=None, train=False, valid=False, xval=False): """ Generate model metrics for this model on test_data. :param H2OFrame test_data: Data set for which model metrics shall be computed against. All three of train, valid and xval arguments are ignored ...
[ "Generate", "model", "metrics", "for", "this", "model", "on", "test_data", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L321-L354
[ "def", "model_performance", "(", "self", ",", "test_data", "=", "None", ",", "train", "=", "False", ",", "valid", "=", "False", ",", "xval", "=", "False", ")", ":", "if", "test_data", "is", "None", ":", "if", "not", "train", "and", "not", "valid", "a...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.scoring_history
Retrieve Model Score History. :returns: The score history as an H2OTwoDimTable or a Pandas DataFrame.
h2o-py/h2o/model/model_base.py
def scoring_history(self): """ Retrieve Model Score History. :returns: The score history as an H2OTwoDimTable or a Pandas DataFrame. """ model = self._model_json["output"] if "scoring_history" in model and model["scoring_history"] is not None: return model["s...
def scoring_history(self): """ Retrieve Model Score History. :returns: The score history as an H2OTwoDimTable or a Pandas DataFrame. """ model = self._model_json["output"] if "scoring_history" in model and model["scoring_history"] is not None: return model["s...
[ "Retrieve", "Model", "Score", "History", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L357-L366
[ "def", "scoring_history", "(", "self", ")", ":", "model", "=", "self", ".", "_model_json", "[", "\"output\"", "]", "if", "\"scoring_history\"", "in", "model", "and", "model", "[", "\"scoring_history\"", "]", "is", "not", "None", ":", "return", "model", "[", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.show
Print innards of model, without regards to type.
h2o-py/h2o/model/model_base.py
def show(self): """Print innards of model, without regards to type.""" if self._future: self._job.poll_once() return if self._model_json is None: print("No model trained yet") return if self.model_id is None: print("This H2OEsti...
def show(self): """Print innards of model, without regards to type.""" if self._future: self._job.poll_once() return if self._model_json is None: print("No model trained yet") return if self.model_id is None: print("This H2OEsti...
[ "Print", "innards", "of", "model", "without", "regards", "to", "type", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L389-L423
[ "def", "show", "(", "self", ")", ":", "if", "self", ".", "_future", ":", "self", ".", "_job", ".", "poll_once", "(", ")", "return", "if", "self", ".", "_model_json", "is", "None", ":", "print", "(", "\"No model trained yet\"", ")", "return", "if", "sel...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.varimp
Pretty print the variable importances, or return them in a list. :param use_pandas: If True, then the variable importances will be returned as a pandas data frame. :returns: A list or Pandas DataFrame.
h2o-py/h2o/model/model_base.py
def varimp(self, use_pandas=False): """ Pretty print the variable importances, or return them in a list. :param use_pandas: If True, then the variable importances will be returned as a pandas data frame. :returns: A list or Pandas DataFrame. """ model = self._model_json...
def varimp(self, use_pandas=False): """ Pretty print the variable importances, or return them in a list. :param use_pandas: If True, then the variable importances will be returned as a pandas data frame. :returns: A list or Pandas DataFrame. """ model = self._model_json...
[ "Pretty", "print", "the", "variable", "importances", "or", "return", "them", "in", "a", "list", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L426-L459
[ "def", "varimp", "(", "self", ",", "use_pandas", "=", "False", ")", ":", "model", "=", "self", ".", "_model_json", "[", "\"output\"", "]", "if", "self", ".", "algo", "==", "'glm'", "or", "\"variable_importances\"", "in", "list", "(", "model", ".", "keys"...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.residual_degrees_of_freedom
Retreive the residual degress of freedom if this model has the attribute, or None otherwise. :param bool train: Get the residual dof for the training set. If both train and valid are False, then train is selected by default. :param bool valid: Get the residual dof for the validation set. If...
h2o-py/h2o/model/model_base.py
def residual_degrees_of_freedom(self, train=False, valid=False, xval=False): """ Retreive the residual degress of freedom if this model has the attribute, or None otherwise. :param bool train: Get the residual dof for the training set. If both train and valid are False, then train i...
def residual_degrees_of_freedom(self, train=False, valid=False, xval=False): """ Retreive the residual degress of freedom if this model has the attribute, or None otherwise. :param bool train: Get the residual dof for the training set. If both train and valid are False, then train i...
[ "Retreive", "the", "residual", "degress", "of", "freedom", "if", "this", "model", "has", "the", "attribute", "or", "None", "otherwise", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L482-L499
[ "def", "residual_degrees_of_freedom", "(", "self", ",", "train", "=", "False", ",", "valid", "=", "False", ",", "xval", "=", "False", ")", ":", "if", "xval", ":", "raise", "H2OValueError", "(", "\"Cross-validation metrics are not available.\"", ")", "if", "not",...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.coef
Return the coefficients which can be applied to the non-standardized data. Note: standardize = True by default, if set to False then coef() return the coefficients which are fit directly.
h2o-py/h2o/model/model_base.py
def coef(self): """ Return the coefficients which can be applied to the non-standardized data. Note: standardize = True by default, if set to False then coef() return the coefficients which are fit directly. """ tbl = self._model_json["output"]["coefficients_table"] if t...
def coef(self): """ Return the coefficients which can be applied to the non-standardized data. Note: standardize = True by default, if set to False then coef() return the coefficients which are fit directly. """ tbl = self._model_json["output"]["coefficients_table"] if t...
[ "Return", "the", "coefficients", "which", "can", "be", "applied", "to", "the", "non", "-", "standardized", "data", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L547-L556
[ "def", "coef", "(", "self", ")", ":", "tbl", "=", "self", ".", "_model_json", "[", "\"output\"", "]", "[", "\"coefficients_table\"", "]", "if", "tbl", "is", "None", ":", "return", "None", "return", "{", "name", ":", "coef", "for", "name", ",", "coef", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.coef_norm
Return coefficients fitted on the standardized data (requires standardize = True, which is on by default). These coefficients can be used to evaluate variable importance.
h2o-py/h2o/model/model_base.py
def coef_norm(self): """ Return coefficients fitted on the standardized data (requires standardize = True, which is on by default). These coefficients can be used to evaluate variable importance. """ if self._model_json["output"]["model_category"]=="Multinomial": tbl...
def coef_norm(self): """ Return coefficients fitted on the standardized data (requires standardize = True, which is on by default). These coefficients can be used to evaluate variable importance. """ if self._model_json["output"]["model_category"]=="Multinomial": tbl...
[ "Return", "coefficients", "fitted", "on", "the", "standardized", "data", "(", "requires", "standardize", "=", "True", "which", "is", "on", "by", "default", ")", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L559-L574
[ "def", "coef_norm", "(", "self", ")", ":", "if", "self", ".", "_model_json", "[", "\"output\"", "]", "[", "\"model_category\"", "]", "==", "\"Multinomial\"", ":", "tbl", "=", "self", ".", "_model_json", "[", "\"output\"", "]", "[", "\"standardized_coefficient_...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.download_pojo
Download the POJO for this model to the directory specified by path. If path is an empty string, then dump the output to screen. :param path: An absolute path to the directory where POJO should be saved. :param get_genmodel_jar: if True, then also download h2o-genmodel.jar and store it in fol...
h2o-py/h2o/model/model_base.py
def download_pojo(self, path="", get_genmodel_jar=False, genmodel_name=""): """ Download the POJO for this model to the directory specified by path. If path is an empty string, then dump the output to screen. :param path: An absolute path to the directory where POJO should be saved. ...
def download_pojo(self, path="", get_genmodel_jar=False, genmodel_name=""): """ Download the POJO for this model to the directory specified by path. If path is an empty string, then dump the output to screen. :param path: An absolute path to the directory where POJO should be saved. ...
[ "Download", "the", "POJO", "for", "this", "model", "to", "the", "directory", "specified", "by", "path", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L784-L798
[ "def", "download_pojo", "(", "self", ",", "path", "=", "\"\"", ",", "get_genmodel_jar", "=", "False", ",", "genmodel_name", "=", "\"\"", ")", ":", "assert_is_type", "(", "path", ",", "str", ")", "assert_is_type", "(", "get_genmodel_jar", ",", "bool", ")", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.download_mojo
Download the model in MOJO format. :param path: the path where MOJO file should be saved. :param get_genmodel_jar: if True, then also download h2o-genmodel.jar and store it in folder ``path``. :param genmodel_name Custom name of genmodel jar :returns: name of the MOJO file written.
h2o-py/h2o/model/model_base.py
def download_mojo(self, path=".", get_genmodel_jar=False, genmodel_name=""): """ Download the model in MOJO format. :param path: the path where MOJO file should be saved. :param get_genmodel_jar: if True, then also download h2o-genmodel.jar and store it in folder ``path``. :para...
def download_mojo(self, path=".", get_genmodel_jar=False, genmodel_name=""): """ Download the model in MOJO format. :param path: the path where MOJO file should be saved. :param get_genmodel_jar: if True, then also download h2o-genmodel.jar and store it in folder ``path``. :para...
[ "Download", "the", "model", "in", "MOJO", "format", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L801-L821
[ "def", "download_mojo", "(", "self", ",", "path", "=", "\".\"", ",", "get_genmodel_jar", "=", "False", ",", "genmodel_name", "=", "\"\"", ")", ":", "assert_is_type", "(", "path", ",", "str", ")", "assert_is_type", "(", "get_genmodel_jar", ",", "bool", ")", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.save_mojo
Save an H2O Model as MOJO (Model Object, Optimized) to disk. :param model: The model object to save. :param path: a path to save the model at (hdfs, s3, local) :param force: if True overwrite destination directory in case it exists, or throw exception if set to False. :returns str: the...
h2o-py/h2o/model/model_base.py
def save_mojo(self, path="", force=False): """ Save an H2O Model as MOJO (Model Object, Optimized) to disk. :param model: The model object to save. :param path: a path to save the model at (hdfs, s3, local) :param force: if True overwrite destination directory in case it exists,...
def save_mojo(self, path="", force=False): """ Save an H2O Model as MOJO (Model Object, Optimized) to disk. :param model: The model object to save. :param path: a path to save the model at (hdfs, s3, local) :param force: if True overwrite destination directory in case it exists,...
[ "Save", "an", "H2O", "Model", "as", "MOJO", "(", "Model", "Object", "Optimized", ")", "to", "disk", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L823-L838
[ "def", "save_mojo", "(", "self", ",", "path", "=", "\"\"", ",", "force", "=", "False", ")", ":", "assert_is_type", "(", "path", ",", "str", ")", "assert_is_type", "(", "force", ",", "bool", ")", "if", "not", "self", ".", "have_mojo", ":", "raise", "H...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.save_model_details
Save Model Details of an H2O Model in JSON Format to disk. :param model: The model object to save. :param path: a path to save the model details at (hdfs, s3, local) :param force: if True overwrite destination directory in case it exists, or throw exception if set to False. :returns st...
h2o-py/h2o/model/model_base.py
def save_model_details(self, path="", force=False): """ Save Model Details of an H2O Model in JSON Format to disk. :param model: The model object to save. :param path: a path to save the model details at (hdfs, s3, local) :param force: if True overwrite destination directory in ...
def save_model_details(self, path="", force=False): """ Save Model Details of an H2O Model in JSON Format to disk. :param model: The model object to save. :param path: a path to save the model details at (hdfs, s3, local) :param force: if True overwrite destination directory in ...
[ "Save", "Model", "Details", "of", "an", "H2O", "Model", "in", "JSON", "Format", "to", "disk", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L840-L853
[ "def", "save_model_details", "(", "self", ",", "path", "=", "\"\"", ",", "force", "=", "False", ")", ":", "assert_is_type", "(", "path", ",", "str", ")", "assert_is_type", "(", "force", ",", "bool", ")", "path", "=", "os", ".", "path", ".", "join", "...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.partial_plot
Create partial dependence plot which gives a graphical depiction of the marginal effect of a variable on the response. The effect of a variable is measured in change in the mean response. :param H2OFrame data: An H2OFrame object used for scoring and constructing the plot. :param cols: Feature(s...
h2o-py/h2o/model/model_base.py
def partial_plot(self, data, cols, destination_key=None, nbins=20, weight_column=None, plot=True, plot_stddev = True, figsize=(7, 10), server=False, include_na=False, user_splits=None, save_to_file=None): """ Create partial dependence plot which gives a graphica...
def partial_plot(self, data, cols, destination_key=None, nbins=20, weight_column=None, plot=True, plot_stddev = True, figsize=(7, 10), server=False, include_na=False, user_splits=None, save_to_file=None): """ Create partial dependence plot which gives a graphica...
[ "Create", "partial", "dependence", "plot", "which", "gives", "a", "graphical", "depiction", "of", "the", "marginal", "effect", "of", "a", "variable", "on", "the", "response", ".", "The", "effect", "of", "a", "variable", "is", "measured", "in", "change", "in"...
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L943-L1092
[ "def", "partial_plot", "(", "self", ",", "data", ",", "cols", ",", "destination_key", "=", "None", ",", "nbins", "=", "20", ",", "weight_column", "=", "None", ",", "plot", "=", "True", ",", "plot_stddev", "=", "True", ",", "figsize", "=", "(", "7", "...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.varimp_plot
Plot the variable importance for a trained model. :param num_of_features: the number of features shown in the plot (default is 10 or all if less than 10). :param server: ? :returns: None.
h2o-py/h2o/model/model_base.py
def varimp_plot(self, num_of_features=None, server=False): """ Plot the variable importance for a trained model. :param num_of_features: the number of features shown in the plot (default is 10 or all if less than 10). :param server: ? :returns: None. """ assert_...
def varimp_plot(self, num_of_features=None, server=False): """ Plot the variable importance for a trained model. :param num_of_features: the number of features shown in the plot (default is 10 or all if less than 10). :param server: ? :returns: None. """ assert_...
[ "Plot", "the", "variable", "importance", "for", "a", "trained", "model", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L1095-L1178
[ "def", "varimp_plot", "(", "self", ",", "num_of_features", "=", "None", ",", "server", "=", "False", ")", ":", "assert_is_type", "(", "num_of_features", ",", "None", ",", "int", ")", "assert_is_type", "(", "server", ",", "bool", ")", "plt", "=", "_get_matp...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.std_coef_plot
Plot a GLM model"s standardized coefficient magnitudes. :param num_of_features: the number of features shown in the plot. :param server: ? :returns: None.
h2o-py/h2o/model/model_base.py
def std_coef_plot(self, num_of_features=None, server=False): """ Plot a GLM model"s standardized coefficient magnitudes. :param num_of_features: the number of features shown in the plot. :param server: ? :returns: None. """ assert_is_type(num_of_features, None, ...
def std_coef_plot(self, num_of_features=None, server=False): """ Plot a GLM model"s standardized coefficient magnitudes. :param num_of_features: the number of features shown in the plot. :param server: ? :returns: None. """ assert_is_type(num_of_features, None, ...
[ "Plot", "a", "GLM", "model", "s", "standardized", "coefficient", "magnitudes", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L1181-L1295
[ "def", "std_coef_plot", "(", "self", ",", "num_of_features", "=", "None", ",", "server", "=", "False", ")", ":", "assert_is_type", "(", "num_of_features", ",", "None", ",", "I", "(", "int", ",", "lambda", "x", ":", "x", ">", "0", ")", ")", "# check tha...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase._check_targets
Check that y_actual and y_predicted have the same length. :param H2OFrame y_actual: :param H2OFrame y_predicted: :returns: None
h2o-py/h2o/model/model_base.py
def _check_targets(y_actual, y_predicted): """Check that y_actual and y_predicted have the same length. :param H2OFrame y_actual: :param H2OFrame y_predicted: :returns: None """ if len(y_actual) != len(y_predicted): raise ValueError("Row mismatch: [{},{}]".f...
def _check_targets(y_actual, y_predicted): """Check that y_actual and y_predicted have the same length. :param H2OFrame y_actual: :param H2OFrame y_predicted: :returns: None """ if len(y_actual) != len(y_predicted): raise ValueError("Row mismatch: [{},{}]".f...
[ "Check", "that", "y_actual", "and", "y_predicted", "have", "the", "same", "length", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L1299-L1308
[ "def", "_check_targets", "(", "y_actual", ",", "y_predicted", ")", ":", "if", "len", "(", "y_actual", ")", "!=", "len", "(", "y_predicted", ")", ":", "raise", "ValueError", "(", "\"Row mismatch: [{},{}]\"", ".", "format", "(", "len", "(", "y_actual", ")", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.cross_validation_models
Obtain a list of cross-validation models. :returns: list of H2OModel objects.
h2o-py/h2o/model/model_base.py
def cross_validation_models(self): """ Obtain a list of cross-validation models. :returns: list of H2OModel objects. """ cvmodels = self._model_json["output"]["cross_validation_models"] if cvmodels is None: return None m = [] for p in cvmodels: m.append(h...
def cross_validation_models(self): """ Obtain a list of cross-validation models. :returns: list of H2OModel objects. """ cvmodels = self._model_json["output"]["cross_validation_models"] if cvmodels is None: return None m = [] for p in cvmodels: m.append(h...
[ "Obtain", "a", "list", "of", "cross", "-", "validation", "models", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L1311-L1321
[ "def", "cross_validation_models", "(", "self", ")", ":", "cvmodels", "=", "self", ".", "_model_json", "[", "\"output\"", "]", "[", "\"cross_validation_models\"", "]", "if", "cvmodels", "is", "None", ":", "return", "None", "m", "=", "[", "]", "for", "p", "i...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
ModelBase.cross_validation_predictions
Obtain the (out-of-sample) holdout predictions of all cross-validation models on their holdout data. Note that the predictions are expanded to the full number of rows of the training data, with 0 fill-in. :returns: list of H2OFrame objects.
h2o-py/h2o/model/model_base.py
def cross_validation_predictions(self): """ Obtain the (out-of-sample) holdout predictions of all cross-validation models on their holdout data. Note that the predictions are expanded to the full number of rows of the training data, with 0 fill-in. :returns: list of H2OFrame objects. ...
def cross_validation_predictions(self): """ Obtain the (out-of-sample) holdout predictions of all cross-validation models on their holdout data. Note that the predictions are expanded to the full number of rows of the training data, with 0 fill-in. :returns: list of H2OFrame objects. ...
[ "Obtain", "the", "(", "out", "-", "of", "-", "sample", ")", "holdout", "predictions", "of", "all", "cross", "-", "validation", "models", "on", "their", "holdout", "data", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/model/model_base.py#L1324-L1336
[ "def", "cross_validation_predictions", "(", "self", ")", ":", "preds", "=", "self", ".", "_model_json", "[", "\"output\"", "]", "[", "\"cross_validation_predictions\"", "]", "if", "preds", "is", "None", ":", "return", "None", "m", "=", "[", "]", "for", "p", ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8
test
gbm
GBM model demo.
h2o-py/h2o/demos.py
def gbm(interactive=True, echo=True, testing=False): """GBM model demo.""" def demo_body(go): """ Demo of H2O's Gradient Boosting estimator. This demo uploads a dataset to h2o, parses it, and shows a description. Then it divides the dataset into training and test sets, builds a...
def gbm(interactive=True, echo=True, testing=False): """GBM model demo.""" def demo_body(go): """ Demo of H2O's Gradient Boosting estimator. This demo uploads a dataset to h2o, parses it, and shows a description. Then it divides the dataset into training and test sets, builds a...
[ "GBM", "model", "demo", "." ]
h2oai/h2o-3
python
https://github.com/h2oai/h2o-3/blob/dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8/h2o-py/h2o/demos.py#L20-L85
[ "def", "gbm", "(", "interactive", "=", "True", ",", "echo", "=", "True", ",", "testing", "=", "False", ")", ":", "def", "demo_body", "(", "go", ")", ":", "\"\"\"\n Demo of H2O's Gradient Boosting estimator.\n\n This demo uploads a dataset to h2o, parses it, ...
dd62aaa1e7f680a8b16ee14bc66b0fb5195c2ad8