Description Usage Arguments Value Comments Author(s) Examples
Split the data in training/test sets according to a given DoE.
1 2 3 4 5 6 7 8 |
x |
a vector (or matrix) with the input locations. |
y |
a vector with the output observations. |
DoE.idx |
the numeric indices of the training data used in the design. |
DoE.type |
if |
ratio |
if |
seed |
an optional value corresponding to the seed for random methods. |
A list with the DoE: list(xdesign, ydesign, xtest, ytest)
.
This function is in progress. Other types of DoEs will be considered using
the DiceDesign
package.
A. F. Lopez-Lopera.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # generating the toy example
x <- seq(0, 1, length = 100)
y <- sin(4*pi*x)
# regular DoE
DoE <- splitDoE(x, y, DoE.type = "regs", ratio = 0.3)
plot(x,y)
points(DoE$xdesign, DoE$ydesign, col = "red", pch = 20)
points(DoE$xtest, DoE$ytest, col = "blue", pch = 20)
legend("topright", c("training data", "test data"),
pch = rep(20, 2), col = c("red", "blue"))
# random DoE
DoE <- splitDoE(x, y, DoE.type = "rand", ratio = 0.3, seed = 1)
plot(x,y)
points(DoE$xdesign, DoE$ydesign, col = "red", pch = 20)
points(DoE$xtest, DoE$ytest, col = "blue", pch = 20)
legend("topright", c("training data", "test data"),
pch = rep(20, 2), col = c("red", "blue"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.