# NOT RUN {
data("auto_mpg")
train = s2Data( xL = auto_mpg$P1$xL,
yL = auto_mpg$P1$yL,
xU = auto_mpg$P1$xU,
preprocess = TRUE )
show(train)
# Notice how ordered factor variable $cylinders is handled
# .L (linear) .Q (quadratic) .C (cubic) and .^4
head(train$xL)
#if you want to do validation with the unlabeled data
idx = sample(length(auto_mpg$P1$yU), 200)
train = s2Data(xL = auto_mpg$P1$xL, yL = auto_mpg$P1$yL, xU = auto_mpg$P1$xU[idx, ])
valid = s2Data(xL = auto_mpg$P1$xU[-idx, ], yL = auto_mpg$P1$yU[-idx], preprocess = train)
test = s2Data(xL = auto_mpg$P1$xU[idx, ], yL = auto_mpg$P1$yU[idx], preprocess = train)
train
valid
test
# }
Run the code above in your browser using DataLab