I am using TransformedTargetRegressor to transform my target into log space. It is done like
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.compose import TransformedTargetRegressor
clf = TransformedTargetRegressor(regressor=GradientBoostingRegressor(**params),
func=np.log1p, inverse_func=np.expm1)
However when I later call
feature_importance = clf.feature_importances_
I get
AttributeError: 'TransformedTargetRegressor' object has no attribute 'feature_importances_'
I would have thought that all the attributes of the original class would be inherited. How can this be solved?
For further context here is an official example. Replacing the initialization line with mine would result in the crash.