def _predict(self, X, theta): w = theta[:-1] b = theta[-1] logit = np.dot(X, w) + b return sigmoid(logit)
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)
def predict(self, X): w = self.theta[:-1] b = self.theta[-1] return (sigmoid(np.dot(X, w) + b) > 0.5).astype(np.int)