You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for your perfect design. I'm verry sorry for bring some questions. Just as follows, is my code according with your design?
define original X and Y
Y <- df_pm25$PM2.5
X <- df_pm25 %>% select(-PM2.5,-DID,-sitename)
base_model <- SuperLearner(Y = Y, X = X,
SL.library = c("SL.glm","SL.glmnet"),# The first cluster models.
cvControl = list(V=2))
update new X according to the first cluster model
X_1 <- cbind(base_model$Z,X)
names(X_1)[1:2] <- paste0("X",1:2)
meta_model <- SuperLearner(Y = Y, X = X_1,
SL.library = c("SL.ranger","SL.glm"),# The second cluster models.
cvControl = list(V=2))
final
X_2 <- meta_model$Z %>% as.data.frame()
final_model <- SuperLearner(Y = Y, X = X_2,
SL.library = c("SL.nnls"),# The final cluster models.
cvControl = list(V=2))
pre <-final_model$SL.predict # prediction
The text was updated successfully, but these errors were encountered:
kangning-97
changed the title
A novel design, but a little Reva?
A novel design, but a little tedious?
Mar 28, 2022
Thanks for your perfect design. I'm verry sorry for bring some questions. Just as follows, is my code according with your design?
define original X and Y
Y <- df_pm25$PM2.5
X <- df_pm25 %>% select(-PM2.5,-DID,-sitename)
base_model <- SuperLearner(Y = Y, X = X,
SL.library = c("SL.glm","SL.glmnet"),# The first cluster models.
cvControl = list(V=2))
update new X according to the first cluster model
X_1 <- cbind(base_model$Z,X)
names(X_1)[1:2] <- paste0("X",1:2)
meta_model <- SuperLearner(Y = Y, X = X_1,
SL.library = c("SL.ranger","SL.glm"),# The second cluster models.
cvControl = list(V=2))
final
X_2 <- meta_model$Z %>% as.data.frame()
final_model <- SuperLearner(Y = Y, X = X_2,
SL.library = c("SL.nnls"),# The final cluster models.
cvControl = list(V=2))
pre <-final_model$SL.predict # prediction
The text was updated successfully, but these errors were encountered: