代码1
import numpy as np
class Perceptron(object):
"""Perceptron classifier.
Parameters
------------
eta : float
Learning rate (between 0.0 and 1.0)
n_iter : int
Passes over the training dataset.
random_state : int
Random number generator seed for random weight
initialization.
Attributes
-----------
w_ : 1d-array
Weights after fitting.
errors_ : list
Number of misclassifications (updates) in each epoch.
"""
def __init__(self, eta=0.01, n_iter=50, random_state=1):
self.eta = eta
self
《Python Machine Learning》第二章 机器学习分类算法
最新推荐文章于 2020-11-22 19:20:16 发布

最低0.47元/天 解锁文章
2055

被折叠的 条评论
为什么被折叠?



