Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 21, 2026

Implementation Complete: Multi-Output Validation Set Support

  • Explore repository structure and understand validation handling
  • Understand the multi-output regression issue (flatten() breaks 2D output arrays)
  • Add multioutput_train_size parameter to AutoML.init and fit() method
  • Implement _train_val_split method in AutoML class with validation
  • Update documentation for the new parameter
  • Add test case test_multioutput_train_size in test_regression.py
  • Run tests to validate changes (all tests passing)
  • Address code review feedback - added validation and warnings
  • Run security scan with codeql_checker (0 alerts)
  • Verify existing tests still pass
  • Fix formatting with pre-commit hooks

Summary

Successfully implemented the multioutput_train_size parameter that allows users to manually specify a validation set for multi-output regression tasks when using "holdout" evaluation.

Changes (115 lines added):

  • flaml/automl/automl.py: 80 lines added
  • test/automl/test_regression.py: 35 lines added

Key Features:

  1. Parameter Support: Accepts int (number of training samples) or float (proportion 0.0-1.0)
  2. Robust Validation:
    • Validates float values are in (0.0, 1.0)
    • Validates int values are in [1, n_samples-1]
    • Ensures at least 1 sample for validation
  3. Clear Warnings:
    • Warns if X_val/y_val already provided (parameter ignored)
    • Warns if using non-holdout eval_method
  4. Comprehensive Testing:
    • Tests integer and float train_size
    • Tests validation error handling
    • All existing tests still pass

Security: ✅ No security vulnerabilities detected by CodeQL
Formatting: ✅ Pre-commit hooks applied (black, ruff, trailing whitespace)

Original prompt

This section details on the original issue you should resolve

<issue_title>Manually setting the validation set for multi-output task</issue_title>
<issue_description>## Pull request overview

This pull request adds support for manually setting a validation set for multi-output tasks when using the "holdout" evaluation method. Previously, users could not manually specify a validation set for multi-output regression tasks. The new multioutput_train_size parameter allows users to concatenate training and validation data and specify where to split them.

Changes:

  • Added multioutput_train_size parameter to AutoML class for manual validation set specification
  • Implemented _train_val_split method to split concatenated training/validation data
  • Added test case demonstrating the new functionality with MultiOutputRegressor

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
flaml/automl/automl.py Added documentation and implementation for the multioutput_train_size parameter, including the split logic in the fit method
test/automl/test_regression.py Added test_multioutput_train_size function to demonstrate usage of the new feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Originally posted by @copilot in #1302 (review)
</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 21, 2026 06:40
…ication in multi-output tasks

Co-authored-by: thinkall <3197038+thinkall@users.noreply.github.com>
Co-authored-by: thinkall <3197038+thinkall@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for manually setting validation set in multi-output tasks Add multioutput_train_size parameter for manual validation set specification in multi-output tasks Jan 21, 2026
Copilot AI requested a review from thinkall January 21, 2026 06:47
@thinkall
Copy link
Collaborator

@copilot , run pre-commit run --all-files to fix formatting.

Co-authored-by: thinkall <3197038+thinkall@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 21, 2026

@copilot , run pre-commit run --all-files to fix formatting.

Done. Pre-commit hooks applied formatting fixes (black, ruff, trailing whitespace). Committed in 2c336d7.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Manually setting the validation set for multi-output task

2 participants