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.86k stars 2k forks source link

algo not registered #9746

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

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

I call

    Job<Grid> gs = GridSearch.startGridSearch(null, params, hyperParms);
    grid = gs.get();

from testng unit test, but I get this error:

ERRR: java.lang.AssertionError: Unregistered algorithm GBM ERRR: at hex.ModelBuilder.make(ModelBuilder.java:109) ERRR: at hex.grid.GridSearch.startBuildModel(GridSearch.java:322) ERRR: at hex.grid.GridSearch.buildModel(GridSearch.java:306) ERRR: at hex.grid.GridSearch.gridSearch(GridSearch.java:210) ERRR: at hex.grid.GridSearch.access$000(GridSearch.java:68) ERRR: at hex.grid.GridSearch$1.compute2(GridSearch.java:134) ERRR: at water.H2O$H2OCountedCompleter.compute(H2O.java:1181) ERRR: at jsr166y.CountedCompleter.exec(CountedCompleter.java:468) ERRR: at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263) ERRR: at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974) ERRR: at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477) ERRR: at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)

I can get around the problem by explicitly registering the algorithm with

         new GBM(true);

prior to conducting the grid search, but this seems like a hack.

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

Eric Eckstrand commented: new GBMParametersV3(); // as well

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

Michal Malohlava commented: Yeah, the same problem - the static initialization is hell.

Still thinking how to fix that - if we should remove all Reflection stuff and replace by proper registration via SPI.

h2o-ops commented 1 year ago

JIRA Issue Migration Info

Jira Issue: PUBDEV-2812 Assignee: Michal Malohlava Reporter: Eric Eckstrand State: Open Fix Version: N/A Attachments: N/A Development PRs: N/A