Skip to content

[SYSTEMDS-3971] Add Scuro evaluation layer tests - #2639

Open
shieru1214 wants to merge 1 commit into
apache:mainfrom
shieru1214:scuro-eval-tests
Open

shieru1214 wants to merge 1 commit into
apache:mainfrom
shieru1214:scuro-eval-tests

Conversation

@shieru1214

@shieru1214 shieru1214 commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

This change adds tests for the Scuro evaluation layer in two new files. test_split_aware_evaluator.py checks split-aware evaluation, and test_task.py checks cross-validation in Task.

Split-Aware Evaluation

  • EvaluationSplit: The test checks three invalid splits: repeated fit IDs, repeated evaluation IDs, and an ID shared by both parts. Each case should raise a ValueError.
  • Supervised fit: A supervised TfIdf subclass records the inputs to each fit call. The test checks that the instance IDs and labels come only from the fit part of that fold.
  • Node cache: The test builds a TfIdf → MLPAveraging DAG and checks that the node cache stays empty when fitted results are not shared by default. A fitted result depends on the current fold, so it should not be reused across folds by default.
  • _leaf_input: The tests check that a leaf selects the right input by modality ID and representation index, including when the modality ID is a string. An unknown modality or an index out of range should raise an error.
  • _align_partition_shapes: The tests check that shorter partitions are padded with zeros to the longest length, while the longest partition stays unchanged. Data should also stay unchanged when the shapes are already the same or the ranks are different.
  • materialize: The test checks that a modality with neither data nor a loader raises an error.

Cross-Validation in Task

  • Grouped folds: The test uses 20 instances in 10 groups. It checks that the same group does not appear in both the fit and evaluation parts of a fold.
  • Train and test groups: The tests check that a group shared by train and test raises an error. When overlap is explicitly allowed, the task records the shared group.
  • Stratification: The test checks that stratification is enabled for single-label targets but not for multi-label targets. Neither case has a fallback reason. It checks the stratification setting, not the label balance in each fold.

@codecov

codecov Bot commented Nov 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.07692% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.80%. Comparing base (1a358e5) to head (8b8d625).

Files with missing lines Patch % Lines
...n/python/tests/scuro/test_split_aware_evaluator.py 98.38% 2 Missing ⚠️
src/main/python/tests/scuro/test_task.py 96.87% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##               main    #2639       +/-   ##
=============================================
+ Coverage     72.18%   76.80%    +4.61%     
=============================================
  Files          2105      460     -1645     
  Lines        230158    31360   -198798     
  Branches      38694        0    -38694     
=============================================
- Hits         166139    24085   -142054     
+ Misses        52813     7275    -45538     
+ Partials      11206        0    -11206     
Flag Coverage Δ
java ?
python 76.80% <98.07%> (+0.20%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

1 participant