Buggy code:
public boolean _use_all_factor_levels = true ; public DeepLearningModel . DeepLearningParameters . Activation _activation = DeepLearningModel . DeepLearningParameters . Activation . Rectifier ; public int [ ] _hidden = new int [ ] { 200 , 200 } ; public double _epochs = 10 ; public long _train_samples_per_iteration = - 2 ; public double _target_ratio_comm_to_comp = 0.02 ; public long _seed = new Random ( ) . nextLong ( ) ; public boolean _adaptive_rate = true ; public double _rho = 0.99 ; public double _epsilon = 1.0E-8 ; public double _rate = 0.005 ; public double _rate_annealing = 1.0E-6 ; public double _rate_decay = 1.0 ; public double _momentum_start = 0 ; public double _momentum_ramp = 1000000.0 ; public double _momentum_stable = 0 ; public boolean _nesterov_accelerated_gradient = true ; public double _input_dropout_ratio = 0.0 ; public double [ ] _hidden_dropout_ratios ; public double _l1 = 0.0 ; public double _l2 = 0.0 ; public float _max_w2 = Float . POSITIVE_INFINITY ; public DeepLearningModel . DeepLearningParameters . InitialWeightDistribution _initial_weight_distribution = DeepLearningModel . DeepLearningParameters . InitialWeightDistribution . UniformAdaptive ; public double _initial_weight_scale = 1.0 ; public DeepLearningModel . DeepLearningParameters . Loss _loss = DeepLearningModel . DeepLearningParameters . Loss . Automatic ; public double _score_interval = 5 ; public long _score_training_samples = 10000L ; public long _score_validation_samples = 0L ; public double _score_duty_cycle = 0.1 ; public double _classification_stop = 0 ; public double _regression_stop = 1.0E-6 ; public boolean _quiet_mode = false ; public DeepLearningModel . DeepLearningParameters . ClassSamplingMethod _score_validation_sampling = DeepLearningModel . DeepLearningParameters . ClassSamplingMethod . Uniform ; public boolean _diagnostics = true ; public boolean _variable_importances = false ; public boolean _fast_mode = true ; public boolean _ignore_const_cols = true ; public boolean _force_load_balance = true ; public boolean _replicate_training_data = true ; public boolean _single_node_mode = false ; public boolean _shuffle_training_data = false ; public DeepLearningModel . DeepLearningParameters . MissingValuesHandling _missing_values_handling = DeepLearningModel . DeepLearningParameters . MissingValuesHandling . MeanImputation ; public boolean _sparse = false ; public boolean _col_major = false ; public double _average_activation = 0 ; public double _sparsity_beta = 0 ; public int _max_categorical_features = Integer . MAX_VALUE ; public boolean _reproducible = false ; public enum MissingValuesHandling { Skip , MeanImputation ; } public enum ClassSamplingMethod { Uniform , Stratified ; } public enum InitialWeightDistribution { UniformAdaptive , Uniform , Normal ; } public enum Activation { Tanh , TanhWithDropout , Rectifier , RectifierWithDropout , Maxout , MaxoutWithDropout ; } public enum Loss { Automatic , MeanSquare , CrossEntropy ; } void validate ( DeepLearning dl , boolean expensive ) { } } public static class DeepLearningModelOutput extends SupervisedModel . SupervisedOutput { public DeepLearningModelOutput ( ) { } public DeepLearningModelOutput ( DeepLearning b ) { } boolean autoencoder ; Key [ ] weights ; Key [ ] biases ; DeepLearningModel . DeepLearningScoring errors ; TwoDimTable modelSummary ; TwoDimTable scoringHistory ; TwoDimTable variableImportances ; ModelMetrics trainMetrics ; ModelMetrics validMetrics ; double run_time ; @ Override public ModelCategory getModelCategory ( ) { } @ Override public boolean isSupervised ( ) { } } public ModelSchema schema ( ) { } private volatile DeepLearningModel . DeepLearningModelInfo model_info ; void set_model_info ( DeepLearningModel . DeepLearningModelInfo mi ) { } public final DeepLearningModel . DeepLearningModelInfo model_info ( ) { } public long run_time ; private long start_time ; public long actual_train_samples_per_iteration ; public double time_for_communication_us ; public double epoch_counter ; public long training_rows ; public long validation_rows ; private DeepLearningModel . DeepLearningScoring [ ] errors ; public DeepLearningModel . DeepLearningScoring [ ] scoring_history ( ) { } private float _bestError = Float . POSITIVE_INFINITY ; public Key actual_best_model_key ; DeepLearningModel . DeepLearningScoring last_scored ( ) { } public final DeepLearningModel . DeepLearningParameters get_params ( ) { } public float error ( ) { } @ Override public MetricBuilder makeMetricBuilder ( String [ ] domain ) { switch ( _output . getModelCategory ( ) ) { case Binomial : return new ModelMetricsBinomial . MetricBuilderBinomial ( domain , ModelUtils . DEFAULT_THRESHOLDS ) ; case Multinomial : <START_BUG> return new ModelMetricsMultinomial . MetricBuilderMultinomial ( domain ) ; <END_BUG> case Regression : return new ModelMetricsRegression . MetricBuilderRegression ( ) ; case AutoEncoder : return new ModelMetricsAutoEncoder . MetricBuilderAutoEncoder ( _output . nfeatures ( ) ) ; default : throw H2O . unimpl ( ) ; } } public int compareTo ( DeepLearningModel o ) { } public static class DeepLearningScoring extends Iced { public double epoch_counter ; public long training_samples ; public long training_time_ms ; boolean validation ; int num_folds ; public long score_training_samples ; public long score_validation_samples ; public boolean classification ; VarImp variable_importances ; public ConfusionMatrix train_confusion_matrix ; public ConfusionMatrix valid_confusion_matrix ; public double train_err = 1 ; public double valid_err = 1 ; public AUCData trainAUC ; public AUCData validAUC ; public float [ ] train_hitratio ; public float [ ] valid_hitratio ; public double train_mse = Double . POSITIVE_INFINITY ; public double valid_mse = Double . POSITIVE_INFINITY ; public double train_r2 = Double . NaN ; public double valid_r2 = Double . NaN ; public long scoring_time ; DeepLearningModel . DeepLearningScoring deep_clone ( ) { } @ Override public String toString ( ) { } } private static final class ConfMat extends ConfusionMatrix { private final double _err ; private final double _f1 ; public ConfMat ( double err , double f1 ) { } @ Override public double err ( ) { } @ Override public double F1 ( ) { } @ Override public double [ ] classErr ( ) { } } public ConfusionMatrix cm ( ) { } public double mse ( ) { } public VarImp varimp ( ) { } private TwoDimTable createScoringHistoryTable ( DeepLearningModel . DeepLearningScoring [ ] errors ) { } private TwoDimTable createScoringHistoryTable ( DeepLearningModel . DeepLearningScoring [ ] errors , final int size_limit ) { } public static class DeepLearningModelInfo extends Iced { public TwoDimTable summaryTable ; private DataInfo data_info ; public DataInfo data_info ( ) { } private DenseRowMatrix [ ] dense_row_weights ;

Fix:
return new ModelMetricsMultinomial . MetricBuilderMultinomial ( _output . nclasses ( ) , domain ) ;