Method: AprendizajeMaquina::ClasificacionLogistica#predict
- Defined in:
- lib/aprendizaje_maquina/clasificacion_logistica.rb
#predict(x) ⇒ Object
70 71 72 73 74 75 76 77 78 79 |
# File 'lib/aprendizaje_maquina/clasificacion_logistica.rb', line 70 def predict(x) hipo = x * @theta var = 0 hipo.map { |x| var = x.is_a?(Integer) ? x.to_i : x.to_f } if sigmoid(var) >= 0.5 1 else 0 end end |