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

Couldn't get desired output from Adaptive linear neuron implementation #68

Closed sohaibfarooqi closed 3 years ago

sohaibfarooqi commented 6 years ago

Hi, I was trying out one of the example in Chapter2, under title: Implementing an adaptive linear neuron in Python (Link to notebook). The problem is when I plot decision boundaries, whole area is shown red.

screen shot 2017-12-02 at 22 21 25

When I change output = self.activation(X) to output = self.predict(X)inside fit function, the problem seems to be gone.

screen shot 2017-12-02 at 22 21 00

Is there an issue with the code or the code is correct and I made some other mistake while implementing?

Thanks Sohaib

AnshuAyush commented 3 years ago

I guess Your code is correct with proper decision boundary b/w iris flowers with proper explanation.