R - ggplot2 contour plot
问题 I am trying to replicate the code from Andrew Ng's Machine Learning course on Coursera in R (as the course is in Octave). Basically I have to plot a non linear decision boundary (at p = 0.5) for a polynomial regularized logistic regression. I can easily replicate the plot with the base library: contour(u, v, z, levels = 0) points(x = data$Test1, y = data$Test2) where: u <- v <- seq(-1, 1.5, length.out = 100) and z is a matrix 100x100 with the values of z for every point of the grid. Dimension