Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] pass targets to sklearn as 1D and not 2D if univariate column vector #74

Merged
merged 3 commits into from
Sep 10, 2023

Conversation

fkiraly
Copy link
Collaborator

@fkiraly fkiraly commented Sep 10, 2023

sklearn estimators wrapped in BootstrapRegressor or ResidualDouble complain if uni-output target variables are passed as 2D column array, not 1D.

In order to still allow multioutput regressors but avoid the warning, this PR introduces a utility and applies it to flatten uni-output 2D arrays (column vectors) to 1D, but leave multivariate 2D arrays untouched.

@fkiraly fkiraly added enhancement module:regression probabilistic regression module labels Sep 10, 2023
@codecov-commenter
Copy link

codecov-commenter commented Sep 10, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.06% 🎉

Comparison is base (54a73a1) 71.35% compared to head (c6c59ec) 71.41%.
Report is 4 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #74      +/-   ##
==========================================
+ Coverage   71.35%   71.41%   +0.06%     
==========================================
  Files          92       93       +1     
  Lines        4940     4951      +11     
  Branches      897      898       +1     
==========================================
+ Hits         3525     3536      +11     
  Misses       1179     1179              
  Partials      236      236              
Files Changed Coverage Δ
skpro/regression/bootstrap.py 98.18% <100.00%> (+0.06%) ⬆️
skpro/regression/residual.py 97.34% <100.00%> (+0.07%) ⬆️
skpro/utils/numpy.py 100.00% <100.00%> (ø)

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

@fkiraly fkiraly merged commit 84a7e27 into main Sep 10, 2023
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement module:regression probabilistic regression module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants