Example #1
0
 def predict(self, x):
     _linear_predictor_typecheck(x, self._coeff)
     margin = _dot(x, self._coeff) + self._intercept
     if margin > 0:
         prob = 1 / (1 + exp(-margin))
     else:
         prob = 1 - 1 / (1 + exp(margin))
     return 1 if prob > 0.5 else 0
Example #2
0
 def predict(self, x):
     _linear_predictor_typecheck(x, self._coeff)
     margin = _dot(x, self._coeff) + self._intercept
     if margin > 0:
         prob = 1 / (1 + exp(-margin))
     else:
         prob = 1 - 1 / (1 + exp(margin))
     return 1 if prob > 0.5 else 0
Example #3
0
 def predict(self, x):
     _linear_predictor_typecheck(x, self._coeff)
     margin = dot(x, self._coeff) + self._intercept
     return 1 if margin >= 0 else 0
 def predict(self, x):
     _linear_predictor_typecheck(x, self._coeff)
     margin = dot(x, self._coeff) + self._intercept
     return 1 if margin >= 0 else 0
 def predict(self, x):
     """Predict the value of the dependent variable given a vector x"""
     """containing values for the independent variables."""
     _linear_predictor_typecheck(x, self._coeff)
     return dot(self._coeff, x) + self._intercept
 def predict(self, x):
     _linear_predictor_typecheck(x, self._coeff)
     margin = _dot(x, self._coeff) + self._intercept
     return ('1', abs(margin)) if margin >= 0 else ('0', abs(margin))
Example #7
0
 def predict(self, x):
     """Predict the value of the dependent variable given a vector x"""
     """containing values for the independent variables."""
     _linear_predictor_typecheck(x, self._coeff)
     return _dot(x, self._coeff) + self._intercept
 def predict(self, x):
     _linear_predictor_typecheck(x, self._coeff)
     margin = _dot(x, self._coeff) + self._intercept
     return ('1', abs(margin)) if margin >= 0 else ('0', abs(margin))