Skip to content

Machine Learning Scorer ends the run on an empty cell in either scored column #8058

Description

@kz930

What happened?

The operator hands the two configured columns straight to scikit-learn's metric functions:

result['Accuracy'][0] = round(accuracy_score(y_true, y_pred), 4)
prediction = metrics_func[metric](y_true, y_pred, average=None, labels=[label])

When either column has an empty cell, that value reaches the metric as a None, and scikit-learn refuses the pair: ValueError: Classification metrics can't handle a mix of unknown and binary targets. The run ends, and the message names neither the column nor a way out. Nothing in the configuration can exclude the row.

The regression branch is the same shape, calling mean_squared_error and r2_score on the same two columns.

I expected it to score the rows it can and leave the unusable ones out, the way the visualization operators drop missing values before plotting and the Hugging Face operators keep the row with an empty result.

How to reproduce?

  1. Build a table with an actual-value column and a predicted-value column where one row has a blank in either.
  2. Connect Machine Learning Scorer, pointing its two attributes at those columns and selecting any classification metric.
  3. Run.

The run ends with the ValueError below. With every cell filled it completes normally.

Version/Branch

1.3.0-incubating-SNAPSHOT (main)

Relevant log output

ValueError: Classification metrics can't handle a mix of unknown and binary targets

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions