Skip to content

KNearestNeighborsRegressor has no attribute 'estimator' when printing show_models() #1625

Open
@MrKevinDC

Description

@MrKevinDC

I have tried to print the models composing the best ensemble with show_models(), but it fails if a k_nearest_neighbours_regressor is one of them. Is this due to this component not having an initialised self.estimator? I am making a custom component with that modification now, and will update this issue if said model comes up in the ensemble again (whether it fixes it or not).

automl.leaderboard()
rank ensemble_weight type cost duration
model_id
826 1 0.34 decision_tree 0.556544 3.839919
742 2 0.42 k_nearest_neighbors 0.563224 2.659213
1856 3 0.24 adaboost 0.570269 9.341588
automl.show_models()
Traceback (most recent call last):
File "/gpfs/home/xxx/automlBiscuits.py", line 40, in
pprint(automl.show_models(), indent=4)
File "/gpfs/home/xxx/miniconda3/lib/python3.9/site-packages/autosklearn/estimators.py", line 888, in show_models
return self.automl_.show_models()
File "/gpfs/home/xxx/miniconda3/lib/python3.9/site-packages/autosklearn/automl.py", line 2227, in show_models
] = autosklearn_wrapped_model.choice.estimator
AttributeError: 'KNearestNeighborsRegressor' object has no attribute 'estimator'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions