Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validation_data=NULL #6

Open
ablanda opened this issue May 12, 2017 · 3 comments
Open

validation_data=NULL #6

ablanda opened this issue May 12, 2017 · 3 comments

Comments

@ablanda
Copy link

ablanda commented May 12, 2017

Hi, I try to set validation_data=NULL, but after 1 Layer it stops by this message: Error in alloc.col(dt1, length(colnames(dt1)) + length(cols)) :
alloccol has been passed a NULL dt
Could you help me? Thanks

@Laurae2
Copy link
Owner

Laurae2 commented May 14, 2017

Do you have a reproducible example?

@ablanda
Copy link
Author

ablanda commented May 15, 2017

library(Laurae)
library(Matrix)
library(xgboost)
library(data.table)

data("airquality")
airquality<-na.omit(airquality)
nrow(airquality)

label_train<-airquality[,1]
train<-as.data.table(airquality[,-1])

m<-CascadeForest(
training_data = train,
validation_data = NULL,
training_labels = label_train,
folds = folds,
boosting = FALSE,
nthread = 3,

cascade_lr = 1,
training_start = NULL,
validation_start = NULL,
cascade_forests = c(rep(4, 2), 0),
cascade_trees = 100,
cascade_rf = 4,
objective = "reg:linear",
eval_metric = Laurae::df_rmse,
multi_class = FALSE,
early_stopping = 2,
maximize = TRUE,
verbose = TRUE,
essentials = TRUE
)

I think you sholud change at row 306 of Cascade forest's script in validation_data <- if (!is.null(validation_data)) {
Laurae::DTcbind(validation_data, model[[i]]$valid_preds)}
else { NULL }

@Laurae2
Copy link
Owner

Laurae2 commented May 19, 2017

@ablanda My home repo is currently out of sync with the main repo, so I will fix it later.

You can temporarily fix this by doing this like you said:

https://github.com/Laurae2/Laurae/blob/master/R/CascadeForest.R#L306-L307

if (!is.null(validation_data)) {
    validation_data <- Laurae::DTcbind(validation_data, model[[i]]$valid_preds) # Routine overwrites if column names are identical
    validation_start <- if (boosting) {rowMeans(model[[i]]$valid_preds)} else {NULL}
}

do the same for the if here: https://github.com/Laurae2/Laurae/blob/master/R/CascadeForest.R#L445-L446

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants