automl / auto-sklearn

Automated Machine Learning with scikit-learn
https://automl.github.io/auto-sklearn
BSD 3-Clause "New" or "Revised" License
7.56k stars 1.28k forks source link

Unable to add custom component #1253

Closed kshitijgundale closed 2 years ago

kshitijgundale commented 2 years ago

Describe the bug

I am trying to follow this example from docs in Google Colab. But auto-sklearn refuses to acknowledge the newly added component's existence.

ValueError: The provided component 'LDA' for the key 'feature_preprocessor' in the 'include' argument is not valid. The supported components for the step 'feature_preprocessor' for this task are ['densifier', 'extra_trees_preproc_for_classification', 'fast_ica', 'feature_agglomeration', 'kernel_pca', 'kitchen_sinks', 'liblinear_svc_preprocessor', 'no_preprocessing', 'nystroem_sampler', 'pca', 'polynomial', 'random_trees_embedding', 'select_percentile_classification', 'select_rates_classification', _'truncatedSVD']

eddiebergman commented 2 years ago

Hi @kshitijgundale ,

That example works for me, did you perhaps miss the line at the bottom of this code block

autosklearn.pipeline.components.feature_preprocessing.add_preprocessor(LDA)
kshitijgundale commented 2 years ago

Hi, @eddiebergman, thanks for reply. I am sure I included that line after the class declaration. I tried the same code example locally in Linux environment and it worked perfectly. Also, it worked the first time I ran the code. But then started throwing above error in successive attempts. So the problem seems to lie with Google Colab.

eddiebergman commented 2 years ago

Im sorry to hear about that but I'm not sure what we can do on our end. I can try in a Jupyter Notebook which will function somewhat similarly to Google Colab and see if I can reproduce the results.