ENH: `_parameter_constraints` and `_fit_context` for base estimator classes
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Active
- Tech stack
- python
- Domain
- machine-learning
Research direction
This is a design discussion, not a ready task: the issue itself says it requires investigation into how scikit-learn's _parameter_constraints and _fit_context decorator work and how they would be tested here. Start by reading the referenced Emma PR upstream in sklearn and the linked comment (issuecomment-6375401621), then survey the base estimator classes in this repo to see where fit/partial_fit validation would hook in. Done means an agreed design (ideally in this thread) before any patch is attempted.
Written by the indexing model from the issue text.
Description
In Emma's PR at sklearn, we define a parameter constraints dictionary that the sklearn test suite uses to see if the parameters for fit and partial_fit meet standards.
I'm opening this task/discussion if we wanted such a feature for this repo. This would require some work to review/investigate exactly how these are used and how to test them.
The example of _parameter_constraints is below and is usually right under the class YourEstimator() and before def __init__ in many, many sklearn estimators.
_parameter_constraints: dict = {
"hidden_layer_sizes": ["array-like"],
"activation": [
StrOptions(
{
"identity",
"tanh",
"relu",
"logistic",
"softmax",
"softmin",
"log_sigmoid",
"log_softmax",
}
)
],
### other attributes with constraints defined
###
###
}
And you usually put the decorator like below:
@_fit_context(prefer_skip_nested_validation=True)
def fit(self, X, y):
See comment below https://github.com/lanl/GFDL/issues/141#issuecomment-6375401621
- Dominant language
- Python
- Stars
- 3
- Forks
- 6
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 4
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lanl/GFDL
-
BUG: `IndexError` when `hidden_layer_sizes` is a scalarPossibly taken @Ashu56376 claimed this 16 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
MAINT: remove/update cruft in `dependabot.yml`Possibly taken @tylerjereddy claimed this 12 days ago. Openmaintenance
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
maintenance
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
continuous integration testing
Difficulty 3/5 1-2 days Newbie friendliness 57/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
earthtojake/text-to-cad#758 ·
Maintainers usually reply within 1 day
-
domain:upgrades enhancement needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
gke-labs/kube-agents#4634 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
agardnerIT/opamp-server-py#116 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
elviskahoro/sdk-python-attio#144 · 1 comment ·
Maintainers usually reply within 1 day