Exemplo n.º 1
0
Arquivo: h2o.py Projeto: yuecong/h2o-3
def random_forest(x,y,validation_x=None,validation_y=None,**kwargs):
  """
  Build a Random Forest Model (kwargs are the same arguments that you can find in FLOW)

  :return: A new classifier or regression model.
  """
  return h2o_model_builder.supervised_model_build(x,y,validation_x,validation_y,"drf",kwargs)
Exemplo n.º 2
0
Arquivo: h2o.py Projeto: yuecong/h2o-3
def gbm(x,y,validation_x=None,validation_y=None,**kwargs):
  """
  Build a Gradient Boosted Method model (kwargs are the same arguments that you can find in FLOW)

  :return: A new classifier or regression model.
  """
  return h2o_model_builder.supervised_model_build(x,y,validation_x,validation_y,"gbm",kwargs)
Exemplo n.º 3
0
def random_forest(x, y, validation_x=None, validation_y=None, **kwargs):
    """
  Build a Random Forest Model (kwargs are the same arguments that you can find in FLOW)
  """
    return h2o_model_builder.supervised_model_build(x, y, validation_x,
                                                    validation_y, "drf",
                                                    kwargs)
Exemplo n.º 4
0
Arquivo: h2o.py Projeto: yuecong/h2o-3
def deeplearning(x,y=None,validation_x=None,validation_y=None,**kwargs):
  """
  Build a supervised Deep Learning model (kwargs are the same arguments that you can find in FLOW)

  :return: Return a new classifier or regression model.
  """
  return h2o_model_builder.supervised_model_build(x,y,validation_x,validation_y,"deeplearning",kwargs)
Exemplo n.º 5
0
def gbm(x, y, validation_x=None, validation_y=None, **kwargs):
    """
  Build a Gradient Boosted Method model (kwargs are the same arguments that you can find in FLOW)
  """
    return h2o_model_builder.supervised_model_build(x, y, validation_x,
                                                    validation_y, "gbm",
                                                    kwargs)
Exemplo n.º 6
0
def deeplearning(x, y, validation_x=None, validation_y=None, **kwargs):
    """
  Build a supervised Deep Learning model (kwargs are the same arguments that you can find in FLOW)
  """
    return h2o_model_builder.supervised_model_build(x, y, validation_x,
                                                    validation_y,
                                                    "deeplearning", kwargs)
Exemplo n.º 7
0
Arquivo: h2o.py Projeto: moidin/h2o-3
def deeplearning(x,y=None,validation_x=None,validation_y=None,**kwargs):
  """
  Build a supervised Deep Learning model (kwargs are the same arguments that you can find in FLOW)

  :return: Return a new classifier or regression model.
  """
  return h2o_model_builder.supervised_model_build(x,y,validation_x,validation_y,"deeplearning",kwargs)
Exemplo n.º 8
0
Arquivo: h2o.py Projeto: yuecong/h2o-3
def glm(x,y,validation_x=None,validation_y=None,**kwargs):
  """
  Build a Generalized Linear Model (kwargs are the same arguments that you can find in FLOW)

  :return: A new regression or binomial classifier.
  """
  kwargs = dict([(k, kwargs[k]) if k != "Lambda" else ("lambda", kwargs[k]) for k in kwargs])
  return h2o_model_builder.supervised_model_build(x,y,validation_x,validation_y,"glm",kwargs)
Exemplo n.º 9
0
Arquivo: h2o.py Projeto: moidin/h2o-3
def glm(x,y,validation_x=None,validation_y=None,**kwargs):
  """
  Build a Generalized Linear Model (kwargs are the same arguments that you can find in FLOW)

  :return: A new regression or binomial classifier.
  """
  kwargs = dict([(k, kwargs[k]) if k != "Lambda" else ("lambda", kwargs[k]) for k in kwargs])
  return h2o_model_builder.supervised_model_build(x,y,validation_x,validation_y,"glm",kwargs)
Exemplo n.º 10
0
def naive_bayes(x,y,validation_x=None,validation_y=None,**kwargs):
  """
  The naive Bayes classifier assumes independence between predictor variables conditional on the response, and a
  Gaussian distribution of numeric predictors with mean and standard deviation computed from the training dataset.
  When building a naive Bayes classifier, every row in the training dataset that contains at least one NA will be
  skipped completely. If the test dataset has missing values, then those predictors are omitted in the probability
  calculation during prediction.

  :param laplace: A positive number controlling Laplace smoothing. The default zero disables smoothing.
  :param threshold: The minimum standard deviation to use for observations without enough data. Must be at least 1e-10.
  :param eps: A threshold cutoff to deal with numeric instability, must be positive.
  :param compute_metrics: A logical value indicating whether model metrics should be computed. Set to FALSE to reduce
  the runtime of the algorithm.
  :return: Returns an H2OBinomialModel if the response has two categorical levels, H2OMultinomialModel otherwise.
  """
  return h2o_model_builder.supervised_model_build(x,y,validation_x,validation_y,"naivebayes",kwargs)
Exemplo n.º 11
0
Arquivo: h2o.py Projeto: moidin/h2o-3
def naive_bayes(x,y,validation_x=None,validation_y=None,**kwargs):
  """
  The naive Bayes classifier assumes independence between predictor variables conditional on the response, and a
  Gaussian distribution of numeric predictors with mean and standard deviation computed from the training dataset.
  When building a naive Bayes classifier, every row in the training dataset that contains at least one NA will be
  skipped completely. If the test dataset has missing values, then those predictors are omitted in the probability
  calculation during prediction.

  :param laplace: A positive number controlling Laplace smoothing. The default zero disables smoothing.
  :param threshold: The minimum standard deviation to use for observations without enough data. Must be at least 1e-10.
  :param eps: A threshold cutoff to deal with numeric instability, must be positive.
  :param compute_metrics: A logical value indicating whether model metrics should be computed. Set to FALSE to reduce
  the runtime of the algorithm.
  :return: Returns an H2OBinomialModel if the response has two categorical levels, H2OMultinomialModel otherwise.
  """
  return h2o_model_builder.supervised_model_build(x,y,validation_x,validation_y,"naivebayes",kwargs)
Exemplo n.º 12
0
def deeplearning(x,y,validation_x=None,validation_y=None,**kwargs):
  """
  Build a supervised Deep Learning model (kwargs are the same arguments that you can find in FLOW)
  """
  return h2o_model_builder.supervised_model_build(x,y,validation_x,validation_y,"deeplearning",kwargs)