{"action":"created","issue":{"url":"https://api.github.com/repos/pbiecek/bgmm/issues/4","labels_url":"https://api.github.com/repos/pbiecek/bgmm/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/pbiecek/bgmm/issues/4/comments","events_url":"https://api.github.com/repos/pbiecek/bgmm/issues/4/events","html_url":"https://github.com/pbiecek/bgmm/issues/4","id":89173711,"number":4,"title":"crossval breaks on supervised model","user":{"login":"andrewcstewart","id":1420654,"avatar_url":"https://avatars.githubusercontent.com/u/1420654?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewcstewart","html_url":"https://github.com/andrewcstewart","followers_url":"https://api.github.com/users/andrewcstewart/followers","following_url":"https://api.github.com/users/andrewcstewart/following{/other_user}","gists_url":"https://api.github.com/users/andrewcstewart/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewcstewart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewcstewart/subscriptions","organizations_url":"https://api.github.com/users/andrewcstewart/orgs","repos_url":"https://api.github.com/users/andrewcstewart/repos","events_url":"https://api.github.com/users/andrewcstewart/events{/privacy}","received_events_url":"https://api.github.com/users/andrewcstewart/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-18T01:45:46Z","updated_at":"2015-06-18T17:17:10Z","closed_at":null,"body":"Using the supervised example from the documentation, crossval fails with the following error:\r\n\r\n```\r\n> crossval(model = supervised(knowns=genotypes$knowns, \r\n+                     class=genotypes$labels),folds=10)\r\nError in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x),  : \r\n  'data' must be of a vector type, was 'NULL'\r\nIn addition: Warning message:\r\nIn rep(1:folds, length.out = n) :\r\n  first element used of 'length.out' argument\r\n```"},"comment":{"url":"https://api.github.com/repos/pbiecek/bgmm/issues/comments/113225082","html_url":"https://github.com/pbiecek/bgmm/issues/4#issuecomment-113225082","issue_url":"https://api.github.com/repos/pbiecek/bgmm/issues/4","id":113225082,"user":{"login":"pbiecek","id":4624318,"avatar_url":"https://avatars.githubusercontent.com/u/4624318?v=3","gravatar_id":"","url":"https://api.github.com/users/pbiecek","html_url":"https://github.com/pbiecek","followers_url":"https://api.github.com/users/pbiecek/followers","following_url":"https://api.github.com/users/pbiecek/following{/other_user}","gists_url":"https://api.github.com/users/pbiecek/gists{/gist_id}","starred_url":"https://api.github.com/users/pbiecek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbiecek/subscriptions","organizations_url":"https://api.github.com/users/pbiecek/orgs","repos_url":"https://api.github.com/users/pbiecek/repos","events_url":"https://api.github.com/users/pbiecek/events{/privacy}","received_events_url":"https://api.github.com/users/pbiecek/received_events","type":"User","site_admin":false},"created_at":"2015-06-18T17:17:10Z","updated_at":"2015-06-18T17:17:10Z","body":"Thanks, \r\nfor supervised models one needs to set fun=supervised.\r\nI've extended the list of examples in crossval.Rd\r\nto state this requirement directly\r\n(see the example below)\r\n\r\nAlso there was issue with empty X, but now it's fixed\r\n\r\nset.seed(1313)\r\nsimulated = simulateData(d=2, k=3, n=300, m=60, cov=\"0\", within=\"E\", n.labels=2)\r\namodel = supervised(knowns=rbind(simulated$X, simulated$knowns), class=simulated$Ytrue)\r\nstr(crossval(model=amodel, folds=6, fun=supervised))"}}