Skip to content

Commit

Permalink
throw exception if model metrics are incomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Warth committed Feb 25, 2022
1 parent 65e3f13 commit 7703c61
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,7 @@ public static ClassificationMetrics fromProtobuf(@Nullable ScoreMatrixMessage ms

if (msg.getLabelsCount() == 0 && msg.getScoresCount() > 0) {
// Not valid to have score without labels.
log.warn("Skipping classification ScoreMatrix: has scores but no labels");
return null;
throw new IllegalArgumentException("classification ScoreMatrix: has scores but no labels");
}

final int n = labels.size();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ public static RegressionMetrics fromProtobuf(RegressionMetricsMessage msg) {
}

if ("".equals(msg.getPredictionField()) || "".equals(msg.getTargetField())) {
log.warn("Skipping Regression metrics: prediction or target field not set");
return null;
throw new IllegalArgumentException("Regression metrics: prediction or target field not set");
}

val res = new RegressionMetrics(msg.getPredictionField(), msg.getTargetField());
Expand Down

0 comments on commit 7703c61

Please sign in to comment.