Description
Right now accessing attributes which are added to the instances when a method is called (like coef_
in fit
) before they're created, raises a simple python AttributeError
. This is not only on our estimators, but also sometimes on other objects such as display objects.
Since we've had issues / confusions before, I was wondering if we'd want to introduce meaningful error messages when somebody tries to access an attribute which is not there yet, and we can tell them why it's not there. Like, Call fit to have this attribute
or set store_cv_results=True to have this attribute.
In terms of UX, that to me is a very clear improvement, but I'm not sure if we want to add the complexity. We can certainly find ways to make it easier to implement via some python magic, to reduce/minimise the boilerplate code.
cc @scikit-learn/core-devs