O'Reilly logo

Practical Predictive Analytics by Ralph Winters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Simple illustration of a mapping function

To illustrate how a kernel mapping function can help in defining a linear boundary, look at the following plots and see how creating a new variable z will help differentiate among the new transformed points that are mapped by the polynomial function t2$Latitude^2*t2$High.Low.Temp^2 in two-dimensional space. However, a kernel mapping will take place in a higher dimension, and the results of the mapping reverse mapped back into the original space:

#generate a non-linear circle of point 
 
radius <- 2 
t2 <- data.frame(x=radius * cos(seq(0,6,length = 20)),y = radius * sin(seq(0, 6, length = 20))) 
names(t2) <- c("Latitude","High.Low.Temp") 
plot(t2$Latitude,t2$High.Low.Temp) # create a new variable and plot ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required