passing types with get_params method to estimators
See original GitHub issuecurrently get_params
checks for the existence of the get_params
method on the attributes during iteration, however this prevents passing types, which have a get_params
methods because they will throw an exception when the method is called - since the object is not instantiated and get_params
is not bound. I do not believe there is any negative impact here, unless params are being stored as class level attributes, otherwise a reference to the object is required. To patch this can I add a type exclusion criteria in BaseEstimator.get_params
(extending the if deep and hasattr(value, 'get_params')
criteria to exclude if isinstance(value, type)
?
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Developing scikit-learn estimators
The get_params function takes no arguments and returns a dict of the __init__ parameters of the estimator, together with their values. It must...
Read more >sklearn.base — scikit-optimize 0.8.1 documentation
estimator_type = type(estimator) # XXX: not handling dictionaries if estimator_type in ... "estimator as it does not implement a " "'get_params' method.
Read more >Select Right Generic Method with Reflection - Stack Overflow
This is when you pass the actual generic types you want to use in your method. Assuming you wanted the second method above:...
Read more >Developing custom scikit-learn transformers and estimators
All constructor (the __init__ function) parameters should have default ... are of certain type, our estimator passes a class as an argument, ...
Read more >Getting the Most out of scikit-learn Pipelines | by Jessica Miles
You can then pass this composite estimator to a GridSearchCV object and search over ... step to transform different types of data columns...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I don’t think we want to have
get_params
work as a static method.@amueller it’s not OS yet so I can’t point you to it unfortunately. always good to make sure people are not reinventing the wheel 👍