Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def update_coef(learning_rate,error,w,data):
- ip = 1
- for i in range(len(data)-1):
- if ip==1: ## for first iteration to update the interept term
- w[0] = w[0]-learning_rate*error
- ip=ip+1
- vx = learning_rate * error * data[i]
- w[i + 1] = w[i + 1] - vx # updating rest of the coefficients
- return w
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement