def widrow_hoff(x, actual, prediction, learning_rate = 1):
    error = (actual - prediction)
    delta_w = learning_rate * error * x
    print('x       : {}'.format(x))
    print('Error   : {}'.format(error))
    print('delta_w : {}'.format(delta_w)) 

widrow_hoff(5, 10, 8)

"""
Explanation: Widrow-Hoff
a.k.a. delta rule, the ADALINE, or LMS filter
Intuition
End of explanation
"""


widrow_hoff(5, 8, 10)

"""
Explanation: If actual > predicted (error > 0) and x > 0 then we need a larger weight to make up for the difference
End of explanation
"""


widrow_hoff(-5, 10, 8)

"""
Explanation: If actual < predicted (error < 0) and x > 0 then we need to reduce the weight
End of explanation
"""


widrow_hoff(-5, 8, 10)

"""
Explanation: If actual < predicted (error > 0) and x < 0 then we need to decrease the weight
End of explanation
"""


