ageron/handson-ml2

[BUG] Chapter 10: KerasRegressor vs Sci-Keras issue

lxlofpku opened this issue · 0 comments

(I did a quick search in the existing issues about the problem but did not find it.)

Describe the bug
In chapter 10's notebook "10_neural_nets_with_keras.ipynb", cell [95], as I run "keras_reg = keras.wrappers.scikit_learn.KerasRegressor(build_model)" it output the following message:

"/var/folders/s9/zk8r4hnd1p9dh9tf9s0xytfw0000gn/T/ipykernel_6596/1709004121.py:1: DeprecationWarning: KerasRegressor is deprecated, use Sci-Keras (https://github.com/adriangb/scikeras) instead. See https://www.adriangb.com/scikeras/stable/migration.html for help migrating.
keras_reg = keras.wrappers.scikit_learn.KerasRegressor(build_model)"

Following the suggestion, I go to https://github.com/adriangb/scikeras to read the document. Then I try to install "Sci-Keras" by running the following command in a terminal:

pip install scikeras[tensorflow]

However, I only get a message saying that "zsh: no matches found: scikeras[tensorflow]". So, I guess that I have missunderstood something about installation of Sci-Keras. Can you tell me what is the correct way to install Sci-Keras?

Screenshots
See below.

Versions (please complete the following information):

  • OS: MacOSX 12.6.5
  • Python: 3.10
  • TensorFlow: 2.10.1
  • Scikit-Learn: 1.1.3

Xnip2023-05-01_18-05-14