# NOT RUN {
data("auto_mpg")
train = s2Data(xL = auto_mpg$P1$xL, yL = auto_mpg$P1$yL, xU = auto_mpg$P1$xU)
model = s2netR(train,
s2Params(lambda1 = 0.1,
lambda2 = 0,
gamma1 = 0.1,
gamma2 = 100,
gamma3 = 0.1))
# here we tell it to transform the valid data as we did with train.
valid = s2Data(auto_mpg$P1$xU, auto_mpg$P1$yU, preprocess = train)
ypred = predict(model, valid$xL)
# }
# NOT RUN {
if(require(ggplot2)){
ggplot() +
aes(x = ypred, y = valid$yL) + geom_point() +
geom_abline(intercept = 0, slope = 1, linetype = 2)
}
# }
Run the code above in your browser using DataLab