Example #1
0
 def _predict(self, X, theta):
     w = theta[:-1]
     b = theta[-1]
     logit = np.dot(X, w) + b
     return sigmoid(logit)
Example #2
0
 def predict(self, X):
     w = self.theta[:-1]
     b = self.theta[-1]
     # return (np.random.default_rng().uniform(size=X.shape[0]) < sigmoid(
     #     np.dot(X, w) + b)).astype(np.int)
     return (sigmoid(np.dot(X, w) + b) > 0.5).astype(np.int)
Example #3
0
 def predict(self, X):
     w = self.theta[:-1]
     b = self.theta[-1]
     return (sigmoid(np.dot(X, w) + b) > 0.5).astype(np.int)