The XOR Wall by Grid Search
~12 mincode completion
Implement min_perceptron_errors(X, y, grid) returning the smallest error count, as a float, over all (w1,w2,b) drawn from grid.
Where this shows up
~12 min
••••••••••••••••
8 employers weight this skill
4 frontier labs, 2 big tech firms, 1 autonomy company, 1 enterprise vendor. Top match scores 93.
Python
import numpy as np
def min_perceptron_errors(X, y, grid):
"""
Fewest mistakes a single perceptron makes over a grid of weights.
Args:
X: inputs, shape (n, 2)
y: labels in {0, 1}, shape (n,)
grid: candidate values for w1, w2 and b
Returns:
float: the minimum number of misclassified points
"""
# YOUR CODE HERE
pass