perceptron

Perceptron algorithm does not converge correctly

Perceptron algorithm does not converge correctly Question: Given the following labelled data: feature_matrix = np.array ( [ [ 1, 1], [ 2, 3], [ 3, 4], [-0.5, -0.5], [ -1, -2], [ -2, -3], [ -3, -4], [ -4, -3] ] ) labels = np.array ( [ 1, 1, 1, -1, -1, -1, -1, -1 …

Total answers: 2

Perceptron does not learn correctly

Perceptron does not learn correctly Question: I try to do the basic ML. So here is my class of binary classificator perceptron. class perceptron(): def __init__(self, x, y, threshold=0.5, learning_rate=0.1, max_epochs=10): self.threshold = threshold self.learning_rate = learning_rate self.x = x self.y = y self.max_epochs = max_epochs def initialize(self): self.weights = np.random.rand(len(self.x[0])) def train(self): epoch = …

Total answers: 1