Description Usage Arguments Examples
View source: R/MSE_Test_File.R
A S4 plot method for the function MSE_Test
1 | plot.MSE_Test(obj, return_plot = F)
|
obj |
An object of the class |
return_plot |
Logical. Should the plot object be returned (so it may be modified). Returns a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | N <- 1250
Nvar <- 10
N_test <- 150
name_vec <- paste("X", 1:(2*Nvar), sep = "")
# training data:
X <- data.frame(replicate(Nvar, runif(N)),
replicate(Nvar, cut(runif(N), 3,
labels = as.character(1:3))))
mutate(Y = 5*(X3) + .5*X2^2 + ifelse(X6 > 10*X1*X8*X9, 1, 0) + rnorm(N, sd = .05))
names(X) <- c(name_vec, "Y")
# some testing data:
X.t1 <- data.frame(replicate(Nvar, runif(N_test)),
replicate(Nvar, cut(runif(N_test), 3,
labels = as.character(1:3))))
mutate(Y = 5*(X3) + .5*X2^2 + ifelse(X6 > 10*X1*X8*X9, 1, 0) + rnorm(N_test, sd = .05))
names(X.t1) <- c(name_vec, "Y")
# Not specifying test points:
M_no_test <- MSE_Test(X = X %>% dplyr::select(-Y), y = X$Y,
base.learner = "lm", NTest = 100, NTree = 150, B = 1000, var = c( "X3"),
p = .85, glm_cv = T)
# Outputting the plot
plot(M_no_test)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.