{"action":"created","issue":{"url":"https://api.github.com/repos/harrysouthworth/gbm/issues/13","labels_url":"https://api.github.com/repos/harrysouthworth/gbm/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/harrysouthworth/gbm/issues/13/comments","events_url":"https://api.github.com/repos/harrysouthworth/gbm/issues/13/events","html_url":"https://github.com/harrysouthworth/gbm/issues/13","id":29840582,"number":13,"title":"segfault","user":{"login":"harrysouthworth","id":1486592,"avatar_url":"https://avatars.githubusercontent.com/u/1486592?v=3","gravatar_id":"","url":"https://api.github.com/users/harrysouthworth","html_url":"https://github.com/harrysouthworth","followers_url":"https://api.github.com/users/harrysouthworth/followers","following_url":"https://api.github.com/users/harrysouthworth/following{/other_user}","gists_url":"https://api.github.com/users/harrysouthworth/gists{/gist_id}","starred_url":"https://api.github.com/users/harrysouthworth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harrysouthworth/subscriptions","organizations_url":"https://api.github.com/users/harrysouthworth/orgs","repos_url":"https://api.github.com/users/harrysouthworth/repos","events_url":"https://api.github.com/users/harrysouthworth/events{/privacy}","received_events_url":"https://api.github.com/users/harrysouthworth/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-03-20T17:41:00Z","updated_at":"2015-02-01T04:46:18Z","closed_at":null,"body":"Sent to me by email.\r\n\r\nI am testing ‘gbm' on some new data. Using gbm v2.1-05, R 3.0.3 (using the GUI), Max OS 10.9.2. I’ve attached a .rds file with the test data. My response variable is a factor consisting of >40 levels. The predictors are a mix of categorical and numeric/integer. I get an error (actually, R crashes) using ‘gbm.more’. I can replicate with the following code:\r\n\r\nrequire(gbm)\r\nLoading required package: gbm\r\nLoading required package: survival\r\nLoading required package: splines\r\nLoading required package: lattice\r\nLoading required package: parallel\r\nLoaded gbm 2.1-05\r\n\r\ndset = readRDS(“test.rds”)  # Attached .rds file\r\n\r\n# This will complete in ~90 seconds (no errors)\r\nq = gbm(puma00~year+loc+hincp+age+race+educ+hstat+rent+mortgage,\r\n          distribution=\"multinomial\",\r\n          data=dset,\r\n          interaction.depth=4,\r\n          shrinkage = 0.01,\r\n          n.minobsinnode=max(30,ceiling(nrow(dset)*0.001)),\r\n          n.cores=1,\r\n          n.trees=100)\r\n\r\n# Not sure what this error is when printing ‘q’ -- not fatal, just FYI\r\nq\r\ngbm(formula = puma00 ~ year + loc + hincp + age + race + educ + \r\n    hstat + rent + mortgage, distribution = \"multinomial\", data = dset, \r\n    n.trees = 100, interaction.depth = 4, n.minobsinnode = max(30, \r\n        ceiling(nrow(dset) * 0.001)), shrinkage = 0.01, n.cores = 1)\r\nA gradient boosted model with multinomial loss function.\r\n100 iterations were performed.\r\nThere were 9 predictors of which 9 had non-zero influence.\r\nError in apply(x$cv.fitted, 1, function(x, labels) { : \r\n  dim(X) must have a positive length\r\n\r\n# HERE is the real problem: attempt to add 100 trees\r\nq2 = gbm.more(q, n.new.trees=100)\r\n\r\n *** caught segfault ***\r\naddress 0x1c74a8000, cause 'memory not mapped'\r\n\r\nTraceback:\r\n 1: .Call(\"gbm\", Y = as.double(y), Offset = as.double(offset), X = as.double(x),     X.order = as.integer(x.order), weights = as.double(w), Misc = as.double(Misc),     cRows = as.integer(cRows), cCols = as.integer(cCols), var.type = as.integer(object$var.type),     var.monotone = as.integer(object$var.monotone), distribution = as.character(distribution.call.name),     n.trees = as.integer(n.new.trees), interaction.depth = as.integer(object$interaction.depth),     n.minobsinnode = as.integer(object$n.minobsinnode), n.classes = as.integer(object$num.classes),     shrinkage = as.double(object$shrinkage), bag.fraction = as.double(object$bag.fraction),     train.fraction = as.integer(nTrain), fit.old = as.double(object$fit),     n.cat.splits.old = as.integer(length(object$c.splits)), n.trees.old = as.integer(object$n.trees),     verbose = as.integer(verbose), PACKAGE = \"gbm\")\r\n 2: gbm.more(q, n.new.trees = 100)\r\n\r\nPossible actions:\r\n1: abort (with core dump, if enabled)\r\n2: normal R exit\r\n3: exit R without saving workspace\r\n4: exit R saving workspace\r\n\r\n# INTERESTINGLY, if I switch to a numeric response variable, I get different issues:\r\n\r\nq = gbm(hincp~year+loc+age+race+educ+hstat+rent+mortgage,\r\n           distribution=\"gaussian\",\r\n           data=dset,\r\n           interaction.depth=4,\r\n           shrinkage = 0.01,\r\n           n.minobsinnode=max(30,ceiling(nrow(dset)*0.001)),\r\n           n.cores=1,\r\n           n.trees=100)\r\n\r\n# No predictors are included...\r\nq\r\ngbm(formula = hincp ~ year + loc + age + race + educ + hstat + \r\n    rent + mortgage, distribution = \"gaussian\", data = dset, \r\n    n.trees = 100, interaction.depth = 4, n.minobsinnode = max(30, \r\n        ceiling(nrow(dset) * 0.001)), shrinkage = 0.01, n.cores = 1)\r\nA gradient boosted model with gaussian loss function.\r\n100 iterations were performed.\r\nThere were 8 predictors of which 0 had non-zero influence.\r\n\r\nSummary of cross-validation residuals:\r\n  0%  25%  50%  75% 100% \r\n  NA   NA   NA   NA   NA \r\n\r\nCross-validation pseudo R-squared:  1 \r\n\r\nsummary(q)\r\nError in plot.window(xlim, ylim, log = log, ...) : \r\n  need finite 'xlim' values\r\nIn addition: Warning messages:\r\n1: In min(x) : no non-missing arguments to min; returning Inf\r\n2: In max(x) : no non-missing arguments to max; returning -Inf\r\n\r\n# BUT ‘gbm.more’ does not cause R to crash...\r\nq2 = gbm.more(q, n.new.trees=100)  # No error\r\n\r\nAny ideas? Maybe a pointer issue when distribution=“multinomial”?\r\n\r\nMany thanks,\r\nKevin"},"comment":{"url":"https://api.github.com/repos/harrysouthworth/gbm/issues/comments/72351482","html_url":"https://github.com/harrysouthworth/gbm/issues/13#issuecomment-72351482","issue_url":"https://api.github.com/repos/harrysouthworth/gbm/issues/13","id":72351482,"user":{"login":"wilkinsonjason","id":7212512,"avatar_url":"https://avatars.githubusercontent.com/u/7212512?v=3","gravatar_id":"","url":"https://api.github.com/users/wilkinsonjason","html_url":"https://github.com/wilkinsonjason","followers_url":"https://api.github.com/users/wilkinsonjason/followers","following_url":"https://api.github.com/users/wilkinsonjason/following{/other_user}","gists_url":"https://api.github.com/users/wilkinsonjason/gists{/gist_id}","starred_url":"https://api.github.com/users/wilkinsonjason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilkinsonjason/subscriptions","organizations_url":"https://api.github.com/users/wilkinsonjason/orgs","repos_url":"https://api.github.com/users/wilkinsonjason/repos","events_url":"https://api.github.com/users/wilkinsonjason/events{/privacy}","received_events_url":"https://api.github.com/users/wilkinsonjason/received_events","type":"User","site_admin":false},"created_at":"2015-02-01T04:46:18Z","updated_at":"2015-02-01T04:46:18Z","body":"I unfortunately am having a similar issue.  did you find a fix, besides using the gbm.more workaround?"}}