Closed jzhang-gp closed 4 years ago
It turns out that I've already implemented the better solution. I probably forgot I have done that since it was done more than a week ago...Anyway, I've updated the unit test to verify that user can access the estimator.
Description
The current estimator in foreshadow is a
MetaEstimator
instance, which wraps over the user specified estimator or the defaultAutoEstimator
instance. However, to access the actual estimator, users have to use code likeforeshadow.estimator.estimator
orforeshadow.estimator.estimator.estimator
(when using AutoEstimator) even though when creating the foreshadow instance, it isforeshadow = Foreshadow(estimator=YOUR_FAVORITE_ESTIMATOR_INSTANCE)
. This creates an inconsistency on the expectation.This change adds an
estimator_wrapper
attribute and prevents users from accessing theestimator
in the old way.The ration behind is that if we have to expose the internal structure of Foreshadow's estimator, at least be explicit that the true estimator is wrapped.
Another possible solution is to return the actual estimator user specified or the AutoEstimator instance when accessing the
estimator
attribute. In fact, while I'm writing this down, I feel this might be a better solution to further align user expectations. Let me know your thoughts. Thanks!