예제 #1
0
파일: logreg.py 프로젝트: get9/ml-test
 def predict(self, xs):
     if self.bias:
         xs = add_feature_bias(xs)
     return np.rint(self.hfunc(xs, self.ws))
예제 #2
0
파일: logreg.py 프로젝트: get9/ml-test
 def train(self, xs, ys):
     if self.bias:
         xs = add_feature_bias(xs)
     g = GradientDescentOptimizer(self.hfunc, self.costfunc, convergence=1e-6, \
             learning_rate=0.001, regularization=self.l, max_iters=1e4)
     self.ws = g.optimize(xs, ys)