In #1232 we discovered that printing out a Visualizer in a notebook with the KElbowVisualizer was failing because calls to get_params were failing with an attribute error. We also experienced this issue with the DroppingCurve visualizer. ModelVisualizers wrap estimator objects and the error messages from get_params -- AttributeError were confusing, so we updated the Wrapper class to return better error messages.
The fix for the KElbow visualizer was to ensure that all hyperparameters pass in __init__ were getting saved on the estimator because of sklearn's metaprogramming. The fix for DroppingCurve was different. However, to make sure that all our visualizer are working in the future, we should add a simple test_get_params for each visualizer as follows:
def test_get_params(self):
"""
Ensure dropping curve get params works correctly
"""
oz = DroppingCurve(MultinomialNB())
params = oz.get_params()
assert len(params) > 0
Describe the issue
In #1232 we discovered that printing out a Visualizer in a notebook with the
KElbowVisualizer
was failing because calls toget_params
were failing with an attribute error. We also experienced this issue with theDroppingCurve
visualizer.ModelVisualizers
wrap estimator objects and the error messages fromget_params
--AttributeError
were confusing, so we updated theWrapper
class to return better error messages.The fix for the
KElbow
visualizer was to ensure that all hyperparameters pass in__init__
were getting saved on the estimator because of sklearn's metaprogramming. The fix forDroppingCurve
was different. However, to make sure that all our visualizer are working in the future, we should add a simpletest_get_params
for each visualizer as follows: