rasbt / python-machine-learning-book

The "Python Machine Learning (1st edition)" book code repository and info resource
MIT License
12.18k stars 4.39k forks source link

Cannot run a line of code #28

Closed Surry47 closed 7 years ago

Surry47 commented 7 years ago

When I run this script in python notebook:

https://github.com/rasbt/python-machine-learning-book/blob/master/code/optional-py-scripts/ch02.py

The last line (ada.partial_fit(X_std[0, :], y[0])) gives the error:

<main.AdalineSGD at 0x10a89fac8>

rasbt commented 7 years ago

Thanks for the note. The line <main.AdalineSGD at 0x10a89fac8> is not an error as far as I can tell: The fit and partial_fit methods return the AdalineSGD object (self) itself. I just updated the code to ada = ada.partial_fit(X_std[0, :], y[0]) to avoid confusion. Let me know if you have any other questions. (PS: In general, I would recommend using the Jupyter notebooks if you have jupyter notebook installed on your machine).

Cheers, Sebastian