Question
I am trying to learn the Perceptron Learning Alglorthim and how to implement into my code. I am very novice when to comes to both
I am trying to learn the Perceptron Learning Alglorthim and how to implement into my code. I am very novice when to comes to both machine learning and coding so if anyone can explain the code step my step that be great.
The Code:
### The PLA -- finish implementing this
def PLA(X,y,w,max_iter=1000): ### You complete me
### The in-sample error
def E_in(X,y,w): mc = (np.sign(X.dot(w)) != y) return np.sum(mc)/len(mc)
w = np.zeros(X.shape[1]) w,i=PLA(X,y,w) ms.lin_boundary(w,X,y)
print("Finished in {} iterations".format(i)) print("E_in = {}".format(E_in(X,y,w)))
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started