apache / apache/texera

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

Open
#8,058 1 comment 0 reactions 1 assignee Claimed by @kz930 View on GitHub
Dominant language
Scala
Stars
314
Forks
187
Avg merge
1d 21h
Merged PRs (30d)
214

Description

### What happened?

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

```python
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

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.