A bank's loan data has an awkward shape. Plotted by two scaled features, the approved applicants sit in a ring, with denied applicants both inside it and all around it. No straight line can separate a ring from what surrounds it, so a plain linear SVM is out.
A kernel SVM gets a curved boundary by asking a different question. It doesn't ask "which side of a line is this point on?" It asks "how similar is this point to each training point?" For that it needs similarity as a number, and the most common choice is the RBF (Gaussian) kernel:
Task: write rbf_similarity(points_a, points_b, sigma) that returns the kernel matrix. This is a list with one row per point in points_a, where entry [i][j] is (points_a[i], points_b[j]), rounded to 4 decimal places.
points_a and points_b can have different lengths, so the matrix need not be square. They can also be the same list.sigma is greater than 0.Each row of this matrix shows how one new applicant looks to the model: a list of "how close am I to each stored applicant?" A kernel SVM decides from those closeness scores instead of from a line, and that is how its boundary can bend into a circle.