2020
10-15
10-15
python 牛顿法实现逻辑回归(Logistic Regression)
本文采用的训练方法是牛顿法(NewtonMethod)。代码importnumpyasnpclassLogisticRegression(object):"""LogisticRegressionClassifiertrainingbyNewtonMethod"""def__init__(self,error:float=0.7,max_epoch:int=100):""":paramerror:float,ifthedistancebetweennewweightandoldweightislessthanerror,theprocessoftraingwillbreak.:parammax_epoch:iftrainin...
继续阅读 >