Get_feature_names_out

Hi there,
I am getting some errors in the 6th code block of
linear_model_regularization notebook

feature_names = model_first_fold[0].get_feature_names_out(
    input_features=data.columns)

AttributeError: ‘PolynomialFeatures’ object has no attribute ‘get_feature_names_out’

I am not sure if this is due to different version of packages on my system.

(mooc_venv) [mooc_2022]$ python check_env.py
Using python in /mnt/shared/mooc/mooc_venv
3.9.9 (main, Nov 19 2021, 00:00:00) 
[GCC 10.3.1 20210422 (Red Hat 10.3.1-1)]

[ OK ] numpy version 1.21.0
[ OK ] scipy version 1.7.0
[ OK ] matplotlib version 3.4.2
[ OK ] sklearn version 0.24.2
[ OK ] pandas version 1.3.0
[ OK ] seaborn version 0.11.1
[ OK ] notebook version 6.4.0
[ OK ] plotly version 5.1.0
(mooc_venv) [mooc_2022]

Any ideas what may be causing it.
regards
vin

Your version of scikit-learn is 0.24.2. I guess you used our local installation instructions?

The method get_feature_names was deprecated and renamed to get_feature_names_out in 1.0.

To install the latest version with pip:
pip install --upgrade scikit-learn
or with conda:
conda install -c conda-forge scikit-learn

Thanks Arturo,
Upgraded to scikit-learn 1.0.2 and errors gone.