Repository navigation
BUG: coerce scalar hidden_layer_sizes - #158
Conversation
* SI disclosure: I had Claude Sonnet make these changes based in conversation in gh_136 and gh_137. In particular, I had it implement the bug fix that I explicitly wrote in gh_136. * Used the sklearn.neural_network approach to handling a scalar hidden_layer_sizes in MLP-based estimators. * Duplicated this for partial_fit and fit methods in the standard and ensemble estimators * Added 4 regression tests for these fixes
|
My main arguments here to use my proposed design is:
Per #137 (comment) Strictly speaking, there is no need to think about code design for a hypothetical array API implementation #129. That enhancement PR is not guaranteed to be merged anytime soon or ever, but it is worth noting that |
|
Some of the |
tylerjereddy
left a comment
There was a problem hiding this comment.
I confirmed that all 12 test cases correctly fail before the source patch is applied, and that all lines of code in the diff are covered by testing.
I'm not a huge fan of the code duplication and asymmetry in input validation between fit() and partial_fit(), but I can live with it for now.
Separate from my manual review, Opus 5.5 had some complaints, one of which crosses the threshold for opening a new issue, but I won't block on it here.
|
CI failure unrelated. |
|
thanks |
Fixes #136
Supercedes #137
Summary:
NOTES:
fitandpartial_fitfor the standard and ensemble estimators. That could be enhanced via MAINT: reduce initialization logic duplication #153list()probably isn't necessary, but I am explicitly following the code style written bysklearn.neural_networkfor its MLP-based estimatorsself.hidden_layer_sizesis not modified by the coercion in fit, in following thesklearnstandard to not modify variables in__init__partial_fitdoes not have the check thatmin() < 1, as that was an oversight from previous commits, and therefore out of scope here. That would be easily addressed, though, by MAINT: reduce initialization logic duplication #153SI disclosure: I had Claude Sonnet make these changes based in conversation in #136 and #137. In particular, I had it implement the bug fix that I explicitly wrote in #136.