java.lang.RuntimeException: GLM[dest=glm-d216d362-8687-4a88-a897-26192ef32bde, iteration=1, lambda = 0.0]: got NaNs and/or Infs in beta

JIRA | Nidhi Mehta | 1 year ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    for -" ~/h2o-dev/bigdata/laptop/citibike-nyc/2013-07.csv" on a two node cluster, when run - {code:java} buildModel 'glm', {"model_id":"glm-d216d362-8687-4a88-a897-26192ef32bde","training_frame":"X2013_07.hex","nfolds":0,"response_column":"tripduration","ignored_columns":["starttime","stoptime","start station id","start station longitude","end station id","end station name","end station latitude","end station longitude","bikeid","usertype","birth year","gender"],"ignore_const_cols":true,"family":"gaussian","tweedie_variance_power":0,"tweedie_link_power":1,"solver":"IRLSM","alpha":[],"lambda":[0],"lambda_search":false,"nlambdas":100,"standardize":true,"non_negative":false,"fold_assignment":"AUTO","score_each_iteration":false,"compute_p_values":true,"remove_colinear_columns":false,"max_iterations":-1,"link":"family_default","balance_classes":false,"max_confusion_matrix_size":20,"max_hit_ratio_k":10,"keep_cross_validation_predictions":false,"intercept":true,"objective_epsilon":0.000001,"beta_epsilon":0.0001,"gradient_epsilon":0.0001,"prior":-1,"lambda_min_ratio":-1,"max_active_predictors":-1,"class_sampling_factors":[],"max_after_balance_size":5} {code} {code:java} Got exception 'class java.lang.RuntimeException', with msg 'GLM[dest=glm-d216d362-8687-4a88-a897-26192ef32bde, iteration=1, lambda = 0.0]: got NaNs and/or Infs in beta' java.lang.RuntimeException: GLM[dest=glm-d216d362-8687-4a88-a897-26192ef32bde, iteration=1, lambda = 0.0]: got NaNs and/or Infs in beta at hex.glm.GLM$GLMSingleLambdaTsk$Iteration.callback(GLM.java:2038) at hex.glm.GLM$GLMSingleLambdaTsk$Iteration.callback(GLM.java:1921) at water.H2O$H2OCallback.onCompletion(H2O.java:1116) at jsr166y.CountedCompleter.__tryComplete(CountedCompleter.java:425) at water.RPC$2.compute2(RPC.java:621) at water.H2O$H2OCountedCompleter.compute(H2O.java:1057) at jsr166y.CountedCompleter.exec(CountedCompleter.java:468) at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263) at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974) at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477) at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) {code} but when run on 1 node runs fine, but get a bad model (p-values all one) {code:java} hdata = h2o.importFile("/Users/nidhimehta/h2o-dev/bigdata/laptop/citibike-nyc/2013-07.csv") hh =h2o.glm(x =c("start station name","start station latitude"),y = "tripduration",training_frame = hdata, lambda = 0,compute_p_values = T,remove_colinear_columns = F) --- names coefficients std_error z_value 325 start station name.Willoughby Ave & Hall St -60.672039 93997415.051949 -0.000001 326 start station name.Willoughby Ave & Walworth St 1287.155073 90829446.884767 0.000014 327 start station name.Willoughby St & Fleet St -117.654894 93985016.918904 -0.000001 328 start station name.Wythe Ave & Metropolitan Ave 659.314909 35797052.643935 0.000018 329 start station name.York St & Jay St 207.768930 71758409.736402 0.000003 330 start station latitude -1408.199133 2334864990.210110 -0.000001 p_value standardized_coefficients 325 1.000000 -60.672039 326 0.999989 1287.155073 327 1.000000 -117.654894 328 0.999985 659.314909 329 1.000000 207.768930 330 1.000000 -28.986619 {code} while R-glm na's out the last predictor and returns a decent model {code:java} x = read.csv("/Users/nidhimehta/h2o-dev/bigdata/laptop/citibike-nyc/2013-07.csv") gg = glm(formula = tripduration~start.station.name+start.station.latitude,data = x) summary(gg) ......... start.station.nameWilloughby Ave & Walworth St 1341.93595 311.89845 4.302 1.69e-05 *** start.station.nameWilloughby St & Fleet St -60.97084 276.97337 -0.220 0.825768 start.station.nameWythe Ave & Metropolitan Ave 680.90476 200.01770 3.404 0.000664 *** start.station.nameYork St & Jay St 251.04772 209.87106 1.196 0.231619 start.station.latitude NA NA NA NA --- {code} Would be good if H2O - tells the user - #got NaNs and/or Infs in beta : try running with regularization (and returns the NAed out last predictor model?)

    JIRA | 1 year ago | Nidhi Mehta
    java.lang.RuntimeException: GLM[dest=glm-d216d362-8687-4a88-a897-26192ef32bde, iteration=1, lambda = 0.0]: got NaNs and/or Infs in beta
  2. 0

    in Build project version: 3.7.0.3283 see attached log, data availalble upon request {code} 12-04 11:27:27.400 10.22.80.122:54321 18732 FJ-0-7 INFO: Building cross-validation model 1 / 5. 12-04 11:27:27.404 10.22.80.122:54321 18732 FJ-1-5 INFO: Building H2O GLM model with these parameters: 12-04 11:27:27.405 10.22.80.122:54321 18732 FJ-1-5 INFO: {"_model_id":{"name":"glm-843b15fb-ad4e-4d8b-9172-d4193b4d9aab","type":"Key"},"_train":{"name":"glm-843b15fb-ad4e-4d8b-9172-d4193b4d9aab_cv_1_Key_Frame__cdw_modeldata_sample.hex_train","type":"Key"},"_valid":{"name":"glm-843b15fb-ad4e-4d8b-9172-d4193b4d9aab_cv_1_Key_Frame__cdw_modeldata_sample.hex_valid","type":"Key"},"_nfolds":0,"_keep_cross_validation_predictions":false,"_fold_assignment":"AUTO","_distribution":"AUTO","_tweedie_power":1.5,"_ignored_columns":["cmc_chn_nbr","dsum","end_date","eqvolchange","pctdol","pid_key","pl_cat_dollars","pl_cat_n","pl_cat_pctdollars","pl_cat_pctn","pl_cat_pctunits","pl_cat_pctxtrans","pl_cat_units","pl_cat_xtrans","pl_first_date","pl_last_date","ppoint","pre_end_dt","preweeks","pt_factor","sharechange","volgroup"],"_ignore_const_cols":true,"_weights_column":"weights","_offset_column":null,"_fold_column":null,"_score_each_iteration":false,"_stopping_rounds":0,"_stopping_metric":"AUTO","_stopping_tolerance":0.001,"_response_column":"sharegroup","_balance_classes":false,"_max_after_balance_size":5.0,"_class_sampling_factors":null,"_max_hit_ratio_k":10,"_max_confusion_matrix_size":20,"_checkpoint":null,"_standardize":true,"_family":"multinomial","_link":"family_default","_solver":"AUTO","_tweedie_variance_power":0.0,"_tweedie_link_power":1.0,"_alpha":null,"_lambda":null,"_prior":-1.0,"_lambda_search":false,"_nlambdas":100,"_non_negative":false,"_exactLambdas":false,"_lambda_min_ratio":-1.0,"_use_all_factor_levels":false,"_max_iterations":-1,"_intercept":true,"_beta_epsilon":1.0E-4,"_objective_epsilon":1.0E-5,"_gradient_epsilon":1.0E-5,"_obj_reg":-1.0,"_beta_constraints":null,"_max_active_predictors":-1} 12-04 11:27:27.407 10.22.80.122:54321 18732 FJ-1-5 INFO: Dropping ignored columns: [cmc_chn_nbr, dsum, end_date, eqvolchange, pctdol, pid_key, pl_cat_dollars, pl_cat_n, pl_cat_pctdollars, pl_cat_pctn, pl_cat_pctunits, pl_cat_pctxtrans, pl_cat_units, pl_cat_xtrans, pl_first_date, pl_last_date, ppoint, pre_end_dt, preweeks, pt_factor, sharechange, volgroup] 12-04 11:27:29.641 10.22.80.122:54321 18732 FJ-1-5 WARN: _training_frame: Dataset has less than 1/2 of the data after filtering out rows with NAs 12-04 11:27:29.705 10.22.80.122:54321 18732 FJ-0-5 INFO: GLM[dest=glm-843b15fb-ad4e-4d8b-9172-d4193b4d9aab_cv_1, iteration=0, lambda = 0.332]: All 432 coefficients are active 12-04 11:27:31.741 10.22.80.122:54321 18732 FJ-0-5 INFO: GLM[dest=glm-843b15fb-ad4e-4d8b-9172-d4193b4d9aab_cv_1, iteration=1, lambda = 0.332]: iteration computed in 1971 + 59 ms 12-04 11:27:31.741 10.22.80.122:54321 18732 FJ-0-5 INFO: GLM[dest=glm-843b15fb-ad4e-4d8b-9172-d4193b4d9aab_cv_1, iteration=1, lambda = 0.332]: got NaNs and/or Infs in beta 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: FLOW: Job failure.; Got exception 'class java.lang.RuntimeException', with msg 'GLM[dest=glm-843b15fb-ad4e-4d8b-9172-d4193b4d9aab_cv_1, iteration=1, lambda = 0.332]: got NaNs and/or Infs in beta' 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: java.lang.RuntimeException: GLM[dest=glm-843b15fb-ad4e-4d8b-9172-d4193b4d9aab_cv_1, iteration=1, lambda = 0.332]: got NaNs and/or Infs in beta 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at hex.glm.GLM$GLMSingleLambdaTsk$Iteration.callback(GLM.java:1976) 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at hex.glm.GLM$GLMSingleLambdaTsk$Iteration.callback(GLM.java:1901) 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at water.H2O$H2OCallback.onCompletion(H2O.java:1126) 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at jsr166y.CountedCompleter.__tryComplete(CountedCompleter.java:425) 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at jsr166y.CountedCompleter.tryComplete(CountedCompleter.java:383) 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at water.MRTask.compute2(MRTask.java:683) 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at water.H2O$H2OCountedCompleter.compute(H2O.java:1069) 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at jsr166y.CountedCompleter.exec(CountedCompleter.java:468) 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263) 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974) 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477) 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) 12-04 11:28:10.573 10.22.80.122:54321 18732 #13503-14 INFO: {code}

    JIRA | 1 year ago | Hank Roark
    java.lang.RuntimeException: GLM[dest=glm-843b15fb-ad4e-4d8b-9172-d4193b4d9aab_cv_1, iteration=1, lambda = 0.332]: got NaNs and/or Infs in beta
  3. 0

    in Build project version: 3.7.0.3283 see attached log, data availalble upon request {code} 12-04 11:27:27.400 10.22.80.122:54321 18732 FJ-0-7 INFO: Building cross-validation model 1 / 5. 12-04 11:27:27.404 10.22.80.122:54321 18732 FJ-1-5 INFO: Building H2O GLM model with these parameters: 12-04 11:27:27.405 10.22.80.122:54321 18732 FJ-1-5 INFO: {"_model_id":{"name":"glm-843b15fb-ad4e-4d8b-9172-d4193b4d9aab","type":"Key"},"_train":{"name":"glm-843b15fb-ad4e-4d8b-9172-d4193b4d9aab_cv_1_Key_Frame__cdw_modeldata_sample.hex_train","type":"Key"},"_valid":{"name":"glm-843b15fb-ad4e-4d8b-9172-d4193b4d9aab_cv_1_Key_Frame__cdw_modeldata_sample.hex_valid","type":"Key"},"_nfolds":0,"_keep_cross_validation_predictions":false,"_fold_assignment":"AUTO","_distribution":"AUTO","_tweedie_power":1.5,"_ignored_columns":["cmc_chn_nbr","dsum","end_date","eqvolchange","pctdol","pid_key","pl_cat_dollars","pl_cat_n","pl_cat_pctdollars","pl_cat_pctn","pl_cat_pctunits","pl_cat_pctxtrans","pl_cat_units","pl_cat_xtrans","pl_first_date","pl_last_date","ppoint","pre_end_dt","preweeks","pt_factor","sharechange","volgroup"],"_ignore_const_cols":true,"_weights_column":"weights","_offset_column":null,"_fold_column":null,"_score_each_iteration":false,"_stopping_rounds":0,"_stopping_metric":"AUTO","_stopping_tolerance":0.001,"_response_column":"sharegroup","_balance_classes":false,"_max_after_balance_size":5.0,"_class_sampling_factors":null,"_max_hit_ratio_k":10,"_max_confusion_matrix_size":20,"_checkpoint":null,"_standardize":true,"_family":"multinomial","_link":"family_default","_solver":"AUTO","_tweedie_variance_power":0.0,"_tweedie_link_power":1.0,"_alpha":null,"_lambda":null,"_prior":-1.0,"_lambda_search":false,"_nlambdas":100,"_non_negative":false,"_exactLambdas":false,"_lambda_min_ratio":-1.0,"_use_all_factor_levels":false,"_max_iterations":-1,"_intercept":true,"_beta_epsilon":1.0E-4,"_objective_epsilon":1.0E-5,"_gradient_epsilon":1.0E-5,"_obj_reg":-1.0,"_beta_constraints":null,"_max_active_predictors":-1} 12-04 11:27:27.407 10.22.80.122:54321 18732 FJ-1-5 INFO: Dropping ignored columns: [cmc_chn_nbr, dsum, end_date, eqvolchange, pctdol, pid_key, pl_cat_dollars, pl_cat_n, pl_cat_pctdollars, pl_cat_pctn, pl_cat_pctunits, pl_cat_pctxtrans, pl_cat_units, pl_cat_xtrans, pl_first_date, pl_last_date, ppoint, pre_end_dt, preweeks, pt_factor, sharechange, volgroup] 12-04 11:27:29.641 10.22.80.122:54321 18732 FJ-1-5 WARN: _training_frame: Dataset has less than 1/2 of the data after filtering out rows with NAs 12-04 11:27:29.705 10.22.80.122:54321 18732 FJ-0-5 INFO: GLM[dest=glm-843b15fb-ad4e-4d8b-9172-d4193b4d9aab_cv_1, iteration=0, lambda = 0.332]: All 432 coefficients are active 12-04 11:27:31.741 10.22.80.122:54321 18732 FJ-0-5 INFO: GLM[dest=glm-843b15fb-ad4e-4d8b-9172-d4193b4d9aab_cv_1, iteration=1, lambda = 0.332]: iteration computed in 1971 + 59 ms 12-04 11:27:31.741 10.22.80.122:54321 18732 FJ-0-5 INFO: GLM[dest=glm-843b15fb-ad4e-4d8b-9172-d4193b4d9aab_cv_1, iteration=1, lambda = 0.332]: got NaNs and/or Infs in beta 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: FLOW: Job failure.; Got exception 'class java.lang.RuntimeException', with msg 'GLM[dest=glm-843b15fb-ad4e-4d8b-9172-d4193b4d9aab_cv_1, iteration=1, lambda = 0.332]: got NaNs and/or Infs in beta' 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: java.lang.RuntimeException: GLM[dest=glm-843b15fb-ad4e-4d8b-9172-d4193b4d9aab_cv_1, iteration=1, lambda = 0.332]: got NaNs and/or Infs in beta 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at hex.glm.GLM$GLMSingleLambdaTsk$Iteration.callback(GLM.java:1976) 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at hex.glm.GLM$GLMSingleLambdaTsk$Iteration.callback(GLM.java:1901) 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at water.H2O$H2OCallback.onCompletion(H2O.java:1126) 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at jsr166y.CountedCompleter.__tryComplete(CountedCompleter.java:425) 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at jsr166y.CountedCompleter.tryComplete(CountedCompleter.java:383) 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at water.MRTask.compute2(MRTask.java:683) 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at water.H2O$H2OCountedCompleter.compute(H2O.java:1069) 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at jsr166y.CountedCompleter.exec(CountedCompleter.java:468) 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263) 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974) 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477) 12-04 11:27:31.836 10.22.80.122:54321 18732 #13503-14 INFO: at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) 12-04 11:28:10.573 10.22.80.122:54321 18732 #13503-14 INFO: {code}

    JIRA | 1 year ago | Hank Roark
    java.lang.RuntimeException: GLM[dest=glm-843b15fb-ad4e-4d8b-9172-d4193b4d9aab_cv_1, iteration=1, lambda = 0.332]: got NaNs and/or Infs in beta
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    parse attached file to flow and run glm with x1(last column) as weight and y as response when run with -ea option get - Got exception 'class java.lang.AssertionError', with msg 'invalid weight -0.9905744277979471' java.lang.AssertionError: invalid weight -0.9905744277979471 at hex.glm.GLMTask$GLMIterationTask.processRow(GLMTask.java:771) at hex.glm.GLMTask$GLMIterationTask.map(GLMTask.java:738) at water.MRTask.compute2(MRTask.java:443) at water.H2O$H2OCountedCompleter.compute(H2O.java:666) at jsr166y.CountedCompleter.exec(CountedCompleter.java:429) at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263) at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974) at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477) at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) when run without -ea option get - Got exception 'class java.lang.RuntimeException', with msg 'GLM[dest=glm-a31066ea-2808-4849-8b31-0a05477d4f57, iteration=1, lambda = 0.1041]: got NaNs and/or Infs in beta' java.lang.RuntimeException: GLM[dest=glm-a31066ea-2808-4849-8b31-0a05477d4f57, iteration=1, lambda = 0.1041]: got NaNs and/or Infs in beta at hex.glm.GLM$GLMSingleLambdaTsk$Iteration.callback(GLM.java:1142) at hex.glm.GLM$GLMSingleLambdaTsk$Iteration.callback(GLM.java:1078) at water.H2O$H2OCallback.onCompletion(H2O.java:724) at jsr166y.CountedCompleter.tryComplete(CountedCompleter.java:386) at water.MRTask.compute2(MRTask.java:469) at water.H2O$H2OCountedCompleter.compute(H2O.java:666) at jsr166y.CountedCompleter.exec(CountedCompleter.java:429) at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263) at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974) at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477) at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) would be good to tell the user like in R- glm(y~.,data = df,weights = x1) Error in glm(y ~ ., data = df, weights = x1) : negative weights not allowed

    JIRA | 2 years ago | Nidhi Mehta
    java.lang.RuntimeException: GLM[dest=glm-a31066ea-2808-4849-8b31-0a05477d4f57, iteration=1, lambda = 0.1041]: got NaNs and/or Infs in beta

    Root Cause Analysis

    1. java.lang.RuntimeException

      GLM[dest=glm-d216d362-8687-4a88-a897-26192ef32bde, iteration=1, lambda = 0.0]: got NaNs and/or Infs in beta

      at hex.glm.GLM$GLMSingleLambdaTsk$Iteration.callback()
    2. hex.glm
      GLM$GLMSingleLambdaTsk$Iteration.callback
      1. hex.glm.GLM$GLMSingleLambdaTsk$Iteration.callback(GLM.java:2038)
      2. hex.glm.GLM$GLMSingleLambdaTsk$Iteration.callback(GLM.java:1921)
      2 frames
    3. water
      H2O$H2OCallback.onCompletion
      1. water.H2O$H2OCallback.onCompletion(H2O.java:1116)
      1 frame
    4. jsr166y
      CountedCompleter.__tryComplete
      1. jsr166y.CountedCompleter.__tryComplete(CountedCompleter.java:425)
      1 frame
    5. water
      H2O$H2OCountedCompleter.compute
      1. water.RPC$2.compute2(RPC.java:621)
      2. water.H2O$H2OCountedCompleter.compute(H2O.java:1057)
      2 frames
    6. jsr166y
      ForkJoinWorkerThread.run
      1. jsr166y.CountedCompleter.exec(CountedCompleter.java:468)
      2. jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263)
      3. jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974)
      4. jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477)
      5. jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
      5 frames