{"action":"created","issue":{"url":"https://api.github.com/repos/pgmpy/pgmpy/issues/595","repository_url":"https://api.github.com/repos/pgmpy/pgmpy","labels_url":"https://api.github.com/repos/pgmpy/pgmpy/issues/595/labels{/name}","comments_url":"https://api.github.com/repos/pgmpy/pgmpy/issues/595/comments","events_url":"https://api.github.com/repos/pgmpy/pgmpy/issues/595/events","html_url":"https://github.com/pgmpy/pgmpy/issues/595","id":127887279,"number":595,"title":"Refactor TabularCPD","user":{"login":"ankurankan","id":1461453,"avatar_url":"https://avatars.githubusercontent.com/u/1461453?v=3","gravatar_id":"","url":"https://api.github.com/users/ankurankan","html_url":"https://github.com/ankurankan","followers_url":"https://api.github.com/users/ankurankan/followers","following_url":"https://api.github.com/users/ankurankan/following{/other_user}","gists_url":"https://api.github.com/users/ankurankan/gists{/gist_id}","starred_url":"https://api.github.com/users/ankurankan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ankurankan/subscriptions","organizations_url":"https://api.github.com/users/ankurankan/orgs","repos_url":"https://api.github.com/users/ankurankan/repos","events_url":"https://api.github.com/users/ankurankan/events{/privacy}","received_events_url":"https://api.github.com/users/ankurankan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-01-21T10:00:58Z","updated_at":"2016-02-08T06:47:04Z","closed_at":null,"body":"Currently `TabularCPD` has the these attributes: `variable`, `variable_card`, `evidence`, `evidence_card`.\r\nAnd since it inherits `Factor`, it also has: `variables`, `cardinality` and `values`. \r\n\r\n`evidence` and `evidence_card` can be easily derived if we know other attributes. And since we are not directly using `evidence` or `evidence_card` too many times, we can remove these two and compute these when needed. Right now `evidence` and `evidence_card` is adding overhead in a lot of operations because we need to update these as well as `variables` and `cardinality`."},"comment":{"url":"https://api.github.com/repos/pgmpy/pgmpy/issues/comments/181227925","html_url":"https://github.com/pgmpy/pgmpy/issues/595#issuecomment-181227925","issue_url":"https://api.github.com/repos/pgmpy/pgmpy/issues/595","id":181227925,"user":{"login":"ankurankan","id":1461453,"avatar_url":"https://avatars.githubusercontent.com/u/1461453?v=3","gravatar_id":"","url":"https://api.github.com/users/ankurankan","html_url":"https://github.com/ankurankan","followers_url":"https://api.github.com/users/ankurankan/followers","following_url":"https://api.github.com/users/ankurankan/following{/other_user}","gists_url":"https://api.github.com/users/ankurankan/gists{/gist_id}","starred_url":"https://api.github.com/users/ankurankan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ankurankan/subscriptions","organizations_url":"https://api.github.com/users/ankurankan/orgs","repos_url":"https://api.github.com/users/ankurankan/repos","events_url":"https://api.github.com/users/ankurankan/events{/privacy}","received_events_url":"https://api.github.com/users/ankurankan/received_events","type":"User","site_admin":false},"created_at":"2016-02-08T06:47:04Z","updated_at":"2016-02-08T06:47:04Z","body":"@anaviltripathi @khalibartan We shouldn't be supporting set. \r\nI want to remove `evidence` and `evidence_card` because right now we have change 4 properties: `evidence`, `evidence_card`, `variables` and `variable_card` whenever there is some change in the variables and this adds unnecessary overhead. What do you guys think? "}}