INNER CODE UNIT · Python

update

rasbt/machine-learning-book · ch02/ch02.py:145

                update = self.eta * (target - self.predict(xi))
                self.w_ += update * xi
                self.b_ += update
                errors += int(update != 0.0)
            self.errors_.append(errors)
        return self

    def net_input(self, X):
        """Calculate net input"""
        return np.dot(X, self.w_) + self.b_

    def predict(self, X):
        """Return class label after unit step"""
        return np.where(self.net_input(X) >= 0.0, 1, 0)



View source record →

📰 Research Paper
Loading…
⏳ Fetching content…