{"action":"created","issue":{"url":"https://api.github.com/repos/hofnerb/mboost/issues/17","labels_url":"https://api.github.com/repos/hofnerb/mboost/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/hofnerb/mboost/issues/17/comments","events_url":"https://api.github.com/repos/hofnerb/mboost/issues/17/events","html_url":"https://github.com/hofnerb/mboost/issues/17","id":106557758,"number":17,"title":"helper function","user":{"login":"llauriciu","id":14294409,"avatar_url":"https://avatars.githubusercontent.com/u/14294409?v=3","gravatar_id":"","url":"https://api.github.com/users/llauriciu","html_url":"https://github.com/llauriciu","followers_url":"https://api.github.com/users/llauriciu/followers","following_url":"https://api.github.com/users/llauriciu/following{/other_user}","gists_url":"https://api.github.com/users/llauriciu/gists{/gist_id}","starred_url":"https://api.github.com/users/llauriciu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llauriciu/subscriptions","organizations_url":"https://api.github.com/users/llauriciu/orgs","repos_url":"https://api.github.com/users/llauriciu/repos","events_url":"https://api.github.com/users/llauriciu/events{/privacy}","received_events_url":"https://api.github.com/users/llauriciu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-15T13:35:29Z","updated_at":"2015-09-16T07:19:32Z","closed_at":null,"body":"I am currently using the ctm package from R Forge, which also implements model boosting when dealing with ordinal outcomes (i.e., ordered factors).  The predict.ctm()  function delivers an error probably because of: \r\n\r\n function check_newdata() in mboost/R/helpers.R/ \r\nline:  if (!all(sapply(newdata[nm], class) == sapply(mf, class)))\r\n\r\nThis will give an error when the outcome variable is of class \"ordered\" \"factor\". \r\n"},"comment":{"url":"https://api.github.com/repos/hofnerb/mboost/issues/comments/140652738","html_url":"https://github.com/hofnerb/mboost/issues/17#issuecomment-140652738","issue_url":"https://api.github.com/repos/hofnerb/mboost/issues/17","id":140652738,"user":{"login":"sbrockhaus","id":12938366,"avatar_url":"https://avatars.githubusercontent.com/u/12938366?v=3","gravatar_id":"","url":"https://api.github.com/users/sbrockhaus","html_url":"https://github.com/sbrockhaus","followers_url":"https://api.github.com/users/sbrockhaus/followers","following_url":"https://api.github.com/users/sbrockhaus/following{/other_user}","gists_url":"https://api.github.com/users/sbrockhaus/gists{/gist_id}","starred_url":"https://api.github.com/users/sbrockhaus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbrockhaus/subscriptions","organizations_url":"https://api.github.com/users/sbrockhaus/orgs","repos_url":"https://api.github.com/users/sbrockhaus/repos","events_url":"https://api.github.com/users/sbrockhaus/events{/privacy}","received_events_url":"https://api.github.com/users/sbrockhaus/received_events","type":"User","site_admin":false},"created_at":"2015-09-16T07:19:32Z","updated_at":"2015-09-16T07:19:32Z","body":"I think I have the same problem with check_newdata() when using bl1 %X% bl2 with a variable that has more than one class and unsing predict() with newdata. I think the error occurs whenever you have more than one variable in the base-learner and at least one of those variables has more than one class. Consider the following minimal example (based on help of mboost):  \r\n\r\n```javascript\r\nlibrary(mboost)\r\ndata(\"volcano\", package = \"datasets\")\r\nvol <- as.vector(volcano)\r\nx1 <- 1:nrow(volcano)\r\nx2 <- 1:ncol(volcano)\r\nx <- expand.grid(x1, x2)\r\n# generate a variable with more than one class\r\nx$factorz <- I(gl(2, 2, length=nrow(x)))\r\n\r\nmodx <- mboost(vol ~ bbs(Var2, df = 3, knots = 10) %X%\r\n                 bols(factorz, df = 3), data = x,\r\n               control = boost_control(nu = 0.25))\r\n\r\n# try to predict the data, gives error...\r\ntest <- predict(modx, newdata=x)\r\n\r\n# ... as this comparison in check_newdata() is not possible, \r\n# even if the data is the same\r\nsapply(x, class) == sapply(x, class)\r\n```\r\n\r\n"}}