'svc__gamma' to be replaced by 'classifier__gamma'

Hi,

With the latest sklearn version, i.e. 1.0.2, we should set the parameter name to ‘classifier__gamma’ instead of ‘svc__gamma’ as suggested in the instructions.

Maybe the instructions and solution were built on a previous sklearn version. However, the loaded notebook for the exercise is with sklearn 1.0.2.

Are you using Pipeline instead of make_pipeline to build the model? In such case you had to provide an alias to the step of the pipeline that you probably set as “classifier” (as shown in the Visualizing scikit-learn pipelines in Jupyter video).

If you use make_pipeline, the alias will be set to svc by default in this case.

1 Like

That’s right! I did use ‘classifier’ (with Pipeline). Thanks and sorry for the confusion. :blush:

It could be clearer to explicitly specify to use make_pipeline at building the pipeline step so that it’s consistent with svc__gamma

Just to be explicit for future read, the code that induce to set classifier__gamma is:

model = Pipeline(steps=[
    ("preprocessor", StandardScaler()),
    ("classifier", SVC()),
])