{"action":"closed","issue":{"url":"https://api.github.com/repos/thekingofkings/urban-flow-analysis/issues/7","repository_url":"https://api.github.com/repos/thekingofkings/urban-flow-analysis","labels_url":"https://api.github.com/repos/thekingofkings/urban-flow-analysis/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/thekingofkings/urban-flow-analysis/issues/7/comments","events_url":"https://api.github.com/repos/thekingofkings/urban-flow-analysis/issues/7/events","html_url":"https://github.com/thekingofkings/urban-flow-analysis/issues/7","id":148168575,"number":7,"title":"NB model in R is slow","user":{"login":"thekingofkings","id":1566802,"avatar_url":"https://avatars.githubusercontent.com/u/1566802?v=3","gravatar_id":"","url":"https://api.github.com/users/thekingofkings","html_url":"https://github.com/thekingofkings","followers_url":"https://api.github.com/users/thekingofkings/followers","following_url":"https://api.github.com/users/thekingofkings/following{/other_user}","gists_url":"https://api.github.com/users/thekingofkings/gists{/gist_id}","starred_url":"https://api.github.com/users/thekingofkings/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thekingofkings/subscriptions","organizations_url":"https://api.github.com/users/thekingofkings/orgs","repos_url":"https://api.github.com/users/thekingofkings/repos","events_url":"https://api.github.com/users/thekingofkings/events{/privacy}","received_events_url":"https://api.github.com/users/thekingofkings/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/thekingofkings/urban-flow-analysis/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-13T20:04:39Z","updated_at":"2016-04-15T02:37:55Z","closed_at":"2016-04-15T02:37:55Z","body":"# Performance Improvement Proposal\r\n\r\nThe R-version of NB evaluation is extremely slow. Running 1000 iterations with 7 features take more than 12 hours.\r\n\r\n\r\n## Why it is slow\r\nThe main reason is that in each iteration, I have to do the 77 rounds of leave-one-out to get the mean error as one sampled point. So far, there is no theoretic way to improve over this.\r\n\r\n\r\n## What I can do\r\nUse parallel in R, refer to this post [R parallel intro](https://beckmw.wordpress.com/2014/01/21/a-brief-foray-into-parallel-processing-with-r/)\r\n\r\nSeveral related R libraries are:\r\n\r\n* R [foreach](https://cran.r-project.org/web/packages/foreach/index.html)\r\n* R [doParallel](https://cran.r-project.org/web/packages/doParallel/index.html)\r\n\r\nThis is especially efficient to complicated process in one loop iteration."}}