SGDClassifier中TypeError: __init__() got an unexpected keyword argument ‘n_iter‘

TypeError: init() got an unexpected keyword argument ‘n_iter’

scikit-learn官网中介绍:
想要一个适合大规模的线性分类器,又不打算复制一个密集的行优先存储双精度numpy数组作为输入,那么建议使用SGDClassifier类作为替代。

该分类器中的参数n_iter 在新版本中变成了n_iter_no_change

#参数
class sklearn.linear_model.SGDClassifier(loss='hinge', *, penalty='l2', alpha=0.0001, l1_ratio=0.15, fit_intercept=True, max_iter=1000, tol=0.001, shuffle=True, verbose=0, epsilon=0.1, n_jobs=None, random_state=None, learning_rate='optimal', eta0=0.0, power_t=0.5, early_stopping=False, validation_fraction=0.1, n_iter_no_change=5, class_weight=None, warm_start=False, average=False)

官网地址:
https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.SGDClassifier.html#sklearn.linear_model.SGDClassifier

你可能感兴趣的:(python报错解决,python基础知识,sklearn,python,机器学习)