h2o-py/h2o/grid/grid_search.py
def build_model(self, algo_params):
        """(internal)"""
        if algo_params["training_frame"] is None: raise ValueError("Missing training_frame")
        x = algo_params.pop("x")
        y = algo_params.pop("y", None)
        training_frame = algo_params.pop("training_frame")
        validation_frame = algo_params.pop("validation_frame", None)
        is_auto_encoder = (algo_params is not None) and ("autoencoder" in algo_params and algo_params["autoencoder"])
        algo = self.model._compute_algo()  # unique to grid search
        is_unsupervised = is_auto_encoder or algo == "pca" or algo == "svd" or algo == "kmeans" or algo == "glrm"
        if is_auto_encoder and y is not None: raise ValueError("y should not be specified for autoencoder.")
        if not is_unsupervised and y is None: raise ValueError("Missing response")
        if not is_unsupervised:
            y = y if y in training_frame.names else training_frame.names[y]
            self.model._estimator_type = "classifier" if training_frame.types[y] == "enum" else "regressor"
        self._model_build(x, y, training_frame, validation_frame, algo_params)
def build_model(self, algo_params):
        """(internal)"""
        if algo_params["training_frame"] is None: raise ValueError("Missing training_frame")
        x = algo_params.pop("x")
        y = algo_params.pop("y", None)
        training_frame = algo_params.pop("training_frame")
        validation_frame = algo_params.pop("validation_frame", None)
        is_auto_encoder = (algo_params is not None) and ("autoencoder" in algo_params and algo_params["autoencoder"])
        algo = self.model._compute_algo()  # unique to grid search
        is_unsupervised = is_auto_encoder or algo == "pca" or algo == "svd" or algo == "kmeans" or algo == "glrm"
        if is_auto_encoder and y is not None: raise ValueError("y should not be specified for autoencoder.")
        if not is_unsupervised and y is None: raise ValueError("Missing response")
        if not is_unsupervised:
            y = y if y in training_frame.names else training_frame.names[y]
            self.model._estimator_type = "classifier" if training_frame.types[y] == "enum" else "regressor"
        self._model_build(x, y, training_frame, validation_frame, algo_params)
def build_model ( self , algo_params ) : if algo_params [ "training_frame" ] is None : raise ValueError ( "Missing training_frame" ) x = algo_params . pop ( "x" ) y = algo_params . pop ( "y" , None ) training_frame = algo_params . pop ( "training_frame" ) validation_frame = algo_params . pop ( "validation_frame" , None ) is_auto_encoder = ( algo_params is not None ) and ( "autoencoder" in algo_params and algo_params [ "autoencoder" ] ) algo = self . model . _compute_algo ( ) # unique to grid search is_unsupervised = is_auto_encoder or algo == "pca" or algo == "svd" or algo == "kmeans" or algo == "glrm" if is_auto_encoder and y is not None : raise ValueError ( "y should not be specified for autoencoder." ) if not is_unsupervised and y is None : raise ValueError ( "Missing response" ) if not is_unsupervised : y = y if y in training_frame . names else training_frame . names [ y ] self . model . _estimator_type = "classifier" if training_frame . types [ y ] == "enum" else "regressor" self . _model_build ( x , y , training_frame , validation_frame , algo_params )
(internal)
( internal )