h2oai / h2o-3

H2O is an Open Source, Distributed, Fast & Scalable Machine Learning Platform: Deep Learning, Gradient Boosting (GBM) & XGBoost, Random Forest, Generalized Linear Modeling (GLM with Elastic Net), K-Means, PCA, Generalized Additive Models (GAM), RuleFit, Support Vector Machine (SVM), Stacked Ensembles, Automatic Machine Learning (AutoML), etc.
http://h2o.ai
Apache License 2.0
6.87k stars 1.99k forks source link

XGBoost CV > 3 fails to sample binary response per fold #11452

Open exalate-issue-sync[bot] opened 1 year ago

exalate-issue-sync[bot] commented 1 year ago

XGBoost seems to fail with the following when CV > 3 on the dataset "./smalldata/junit/test_tree_minmax.csv": {code} java.lang.IllegalArgumentException: Domain must have 2 class labels, but is [1] for binomial metrics. {code}

Sample Junit: {code} @Test public void testTreeMinMax() { Frame tfr = null; Frame preds = null; XGBoostModel model = null; Scope.enter(); try { // Parse frame into H2O tfr = parse_test_file("./smalldata/junit/test_tree_minmax.csv"); String response = "response";

  XGBoostModel.XGBoostParameters parms = new XGBoostModel.XGBoostParameters();
  parms._ntrees = 3;
  parms._max_depth = 3;
  parms._train = tfr._key;
  parms._response_column = response;
  parms._nfolds = 3;

  model = new hex.tree.xgboost.XGBoost(parms).trainModel().get();
  Log.info(model);

  preds = model.score(tfr);
} finally {
  if (tfr!=null) tfr.remove();
  if (preds!=null) preds.remove();
  if (model!=null) model.delete(); model.deleteCrossValidationModels();
  Scope.exit();
}

} {code}

exalate-issue-sync[bot] commented 1 year ago

Navdeep commented: Seems to be resolved in this PR: https://github.com/h2oai/h2o-3/pull/1294

hasithjp commented 1 year ago

JIRA Issue Migration Info

Jira Issue: PUBDEV-4569 Assignee: New H2O Bugs Reporter: Navdeep State: Reopened Fix Version: N/A Attachments: N/A Development PRs: N/A