// Predict predicts a labeled value and returns it.
Predict predicts a labeled value and returns it.
// Predict predicts a labeled value and returns it .
func (p *Perceptron) Predict(x []float64) float64 {
	if vector.DotProduct(x, p.W[1:])+p.W[0] >= 0.0 {
		return 1.0
	}
	return -1.0
}
func ( p * Perceptron ) Predict ( x [ ] float64 ) float64 { if vector . DotProduct ( x , p . W [ 1 : ] ) + p . W [ 0 ] >= 0.0 { return 1.0 } return - 1.0 }
Predict predicts a labeled value and returns it.
Predict predicts a labeled value and returns it .