Displaying 2 results from an estimated 2 matches for "xyz_dat".
2020 Oct 27
3
R for-loop to add layer to lattice plot
...kernel = "linear",
scale = FALSE)
# generate contour
xmat = make.grid(matrix(c(testset$x, testset$y),
ncol = 2, byrow=FALSE))
xgrid = as.data.frame(xmat)
names(xgrid) = c("x", "y")
z = predict(svm_model, xgrid)
xyz_dat = as.data.frame(cbind(xgrid, z))
plot_list[[i]] = contourplot(z ~ y+x, data=xyz_dat, pretty = TRUE,
xlim=c(-1,50), ylim=c(-0.001, 0.05),
labels = FALSE, col = "blue", lwd = 0.5)
}
# the contour is stored in the object plot_l...
2020 Oct 28
0
R for-loop to add layer to lattice plot
...scale = FALSE)
> # generate contour
> xmat = make.grid(matrix(c(testset$x, testset$y),
> ncol = 2, byrow=FALSE))
> xgrid = as.data.frame(xmat)
> names(xgrid) = c("x", "y")
> z = predict(svm_model, xgrid)
> xyz_dat = as.data.frame(cbind(xgrid, z))
> plot_list[[i]] = contourplot(z ~ y+x, data=xyz_dat, pretty = TRUE,
> xlim=c(-1,50), ylim=c(-0.001, 0.05),
> labels = FALSE, col = "blue", lwd = 0.5)
>
> }
> # the contour i...