{"action":"created","comment":{"url":"https://api.github.com/repos/pgmpy/pgmpy/pulls/comments/34143073","id":34143073,"diff_hunk":"@@ -0,0 +1,226 @@\n+#!/usr/bin/env python3\n+import numpy as np\n+from pandas import DataFrame\n+\n+from pgmpy.utils import sample_discrete\n+\n+\n+class MarkovChain(object):\n+    \"\"\"\n+    Class to represent a Markov Chain with multiple kernels for factored state space,\n+    along with methods to simulate a run.\n+\n+    Public Methods:\n+    ---------------\n+    set_start_state(state)\n+    add_variable(variable, cardinality)\n+    add_variables_from(vars_list, cards_list)\n+    add_transition_model(variable, transition_dict)\n+    sample(start_state, size)\n+\n+    Examples:\n+    ---------\n+    Create an empty Markov Chain:\n+    >>> from pgmpy.models import MarkovChain as MC\n+    >>> model = MC()\n+\n+    And then add variables to it\n+    >>> model.add_variables_from(['intel', 'diff'], [2, 3])\n+\n+    Or directly create a Markov Chain from a list of variables and their cardinalities\n+    >>> model = MC(['intel', 'diff'], [2, 3])\n+\n+    Add transition models\n+    >>> intel_tm = {0: {0: 0.25, 1: 0.75}, 1: {0: 0.5, 1: 0.5}}\n+    >>> model.add_transition_model('intel', intel_tm)\n+    >>> diff_tm = {0: {0: 0.1, 1: 0.5, 2: 0.4}, 1: {0: 0.2, 1: 0.2, 2: 0.6 }, 2: {0: 0.7, 1: 0.15, 2: 0.15}}\n+    >>> model.add_transition_model('diff', diff_tm)\n+\n+    Set a start state\n+    >>> model.set_start_state({'intel': 0, 'diff': 2})\n+\n+    Sample from it\n+    >>> model.sample(size=5)\n+       intel  diff\n+    0      0     2\n+    1      1     0\n+    2      0     1\n+    3      1     0\n+    4      0     2\n+    \"\"\"\n+    def __init__(self, variables=None, card=None, start_state=None):\n+        \"\"\"\n+        Parameters:\n+        -----------\n+        variables: list\n+            a list of variables of the model.\n+        card: list\n+            a list of cardinalities of the variables.\n+        start_state: dict\n+            representing the starting states of the variables.\n+        \"\"\"\n+        if variables is None:\n+            variables = []\n+        if card is None:\n+            card = []\n+        assert isinstance(card, list)\n+        assert isinstance(variables, list)\n+        self.variables = variables\n+        self.cardinalities = {v: c for v, c in zip(variables, card)}\n+        self.transition_models = {var: {} for var in variables}\n+        if start_state is None or self._check_state(start_state):\n+            self.state = start_state\n+\n+    def set_start_state(self, start_state):\n+        \"\"\"\n+        Set the start state of the Markov Chain.\n+\n+        Parameters:\n+        -----------\n+        start_state: dict\n+            representing the starting states of the variables.\n+\n+        Examples:\n+        ---------\n+        >>> from pgmpy.models import MarkovChain as MC\n+        >>> model = MC(['a', 'b'], [2, 2])\n+        >>> model.set_start_state({'a': 0, 'b': 1})\n+        \"\"\"\n+        if start_state is None or self._check_state(start_state):\n+            self.state = start_state\n+\n+    def _check_state(self, state):\n+        \"\"\"\n+        Checks if the a dict representation of a states of the variables is valid.\n+        \"\"\"\n+        if not isinstance(state, dict):\n+            raise ValueError('Start state must be a dict.')\n+        if not set(state.keys()) == set(self.transition_models.keys()):\n+            raise ValueError('Start state must represent a complete assignment to all variables.')\n+        for var, val in state.items():\n+            if val >= self.cardinalities[var]:\n+                raise ValueError('Assignment {val} to {var} invalid.'.format(val=val, var=var))\n+        return True\n+\n+    def add_variable(self, variable, card=0):\n+        \"\"\"\n+        Add a variable to the model.\n+\n+        Parameters:\n+        -----------\n+        variable: any hashable python object\n+        card: int\n+            representing the cardinality of the variable to be added.\n+\n+        Examples:\n+        ---------\n+        >>> from pgmpy.models import MarkovChain as MC\n+        >>> model = MC()\n+        >>> model.add_variable('x', 4)\n+        \"\"\"\n+        assert variable not in self.variables\n+        self.variables.append(variable)\n+        self.cardinalities[variable] = card\n+        self.transition_models[variable] = {}\n+\n+    def add_variables_from(self, variables, cards):\n+        \"\"\"\n+        Add several variables to the model at once.\n+\n+        Parameters:\n+        -----------\n+        variables: list\n+            list of variables to be added.\n+        cards: list\n+            list of cardinalities of the variables to be added.\n+\n+        Examples:\n+        ---------\n+        >>> from from pgmpy.models import MarkovChain as MC\n+        >>> model = MC()\n+        >>> model.add_variables_from(['x', 'y'], [3, 4])\n+        \"\"\"\n+        for v, c in zip(variables, cards):\n+            self.add_variable(v, c)\n+\n+    def add_transition_model(self, variable, transition_model):\n+        \"\"\"\n+        Adds a transition model for a particular variable.\n+\n+        Parameters:\n+        -----------\n+        variable: any hashable python object\n+            must be an existing variable of the model.\n+        transition_model: dict\n+            representing valid transition probabilities defined for every possible state of the variable.\n+\n+        Examples:\n+        ---------\n+        >>> from pgmpy.models import MarkovChain as MC\n+        >>> model = MC()\n+        >>> model.add_variable('grade', 3)\n+        >>> grade_tm = {0: {0: 0.1, 1: 0.5, 2: 0.4}, 1: {0: 0.2, 1: 0.2, 2: 0.6 }, 2: {0: 0.7, 1: 0.15, 2: 0.15}}\n+        >>> model.add_transition_model('grade', grade_tm)\n+        \"\"\"\n+        # check if the transition model is valid\n+        if not isinstance(transition_model, dict):\n+            raise ValueError('Transition model must be a dict.')\n+        if not set(transition_model.keys()) == set(range(self.cardinalities[variable])):\n+            raise ValueError('Transitions must be defined for all states of variable {var}.'.format(var=variable))\n+        for var, transition in transition_model.items():\n+            if not isinstance(transition, dict):\n+                raise ValueError('Each transition must be a dict.')\n+            prob_sum = 0\n+            for _, prob in transition.items():\n+                if prob < 0 or prob > 1:\n+                    raise ValueError('Transitions must represent valid probability weights.')\n+                prob_sum += prob\n+            if not np.allclose(prob_sum, 1):\n+                raise ValueError('Transition probabilities must sum to 1.')\n+\n+        self.transition_models[variable] = transition_model\n+\n+    def sample(self, start_state=None, size=1):\n+        \"\"\"\n+        Sample from the Markov Chain.\n+\n+        Parameters:\n+        -----------\n+        start_state: dict\n+            representing the starting states of the variables.\n+        size: int\n+            number of samples to be generated.\n+\n+        Examples:\n+        ---------\n+        >>> from pgmpy.models import MarkovChain as MC\n+        >>> model = MC(['intel', 'diff'], [2, 3])\n+        >>> model.set_start_state({'intel': 0, 'diff': 2})\n+        >>> intel_tm = {0: {0: 0.25, 1: 0.75}, 1: {0: 0.5, 1: 0.5}}\n+        >>> model.add_transition_model('intel', intel_tm)\n+        >>> diff_tm = {0: {0: 0.1, 1: 0.5, 2: 0.4}, 1: {0: 0.2, 1: 0.2, 2: 0.6 }, 2: {0: 0.7, 1: 0.15, 2: 0.15}}\n+        >>> model.add_transition_model('diff', diff_tm)\n+        >>> model.sample(size=5)\n+           intel  diff\n+        0      0     2\n+        1      1     0\n+        2      0     1\n+        3      1     0\n+        4      0     2\n+        \"\"\"\n+        # check if the start state is valid\n+        if start_state is not None and self._check_state(start_state):\n+            self.state = start_state\n+        elif start_state is None and self.state is None:\n+            raise ValueError('Start state not set.')\n+\n+        sampled = DataFrame(index=range(size), columns=self.variables)\n+        sampled.loc[0] = [self.state[var] for var in self.variables]\n+        for i in range(size - 1):\n+            for var in self.variables:\n+                val = self.state[var]\n+                next_val = sample_discrete(list(self.transition_models[var][val].keys()),\n+                                           list(self.transition_models[var][val].values()))[0]\n+                self.state[var] = next_val\n+            sampled.loc[i + 1] = [self.state[var] for var in self.variables]","path":"pgmpy/models/MarkovChain.py","position":229,"original_position":225,"commit_id":"110c1312abc21235879ae94f511635823052393b","original_commit_id":"9daef02c0d8f2c492b58fa75789bfa572e7567b3","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},"body":"@pratyakshs This is a bottleneck because it's inside a for loop and is being called too many times.","created_at":"2015-07-08T12:49:54Z","updated_at":"2015-07-08T12:49:54Z","html_url":"https://github.com/pgmpy/pgmpy/pull/442#discussion_r34143073","pull_request_url":"https://api.github.com/repos/pgmpy/pgmpy/pulls/442","_links":{"self":{"href":"https://api.github.com/repos/pgmpy/pgmpy/pulls/comments/34143073"},"html":{"href":"https://github.com/pgmpy/pgmpy/pull/442#discussion_r34143073"},"pull_request":{"href":"https://api.github.com/repos/pgmpy/pgmpy/pulls/442"}}},"pull_request":{"url":"https://api.github.com/repos/pgmpy/pgmpy/pulls/442","id":39085429,"html_url":"https://github.com/pgmpy/pgmpy/pull/442","diff_url":"https://github.com/pgmpy/pgmpy/pull/442.diff","patch_url":"https://github.com/pgmpy/pgmpy/pull/442.patch","issue_url":"https://api.github.com/repos/pgmpy/pgmpy/issues/442","number":442,"state":"open","locked":false,"title":"Markov Chain","user":{"login":"pratyakshs","id":4117104,"avatar_url":"https://avatars.githubusercontent.com/u/4117104?v=3","gravatar_id":"","url":"https://api.github.com/users/pratyakshs","html_url":"https://github.com/pratyakshs","followers_url":"https://api.github.com/users/pratyakshs/followers","following_url":"https://api.github.com/users/pratyakshs/following{/other_user}","gists_url":"https://api.github.com/users/pratyakshs/gists{/gist_id}","starred_url":"https://api.github.com/users/pratyakshs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pratyakshs/subscriptions","organizations_url":"https://api.github.com/users/pratyakshs/orgs","repos_url":"https://api.github.com/users/pratyakshs/repos","events_url":"https://api.github.com/users/pratyakshs/events{/privacy}","received_events_url":"https://api.github.com/users/pratyakshs/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-02T14:01:01Z","updated_at":"2015-07-08T12:49:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"593271a8d739ef1251e10397cafb76aeaa3836e5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pgmpy/pgmpy/pulls/442/commits","review_comments_url":"https://api.github.com/repos/pgmpy/pgmpy/pulls/442/comments","review_comment_url":"https://api.github.com/repos/pgmpy/pgmpy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pgmpy/pgmpy/issues/442/comments","statuses_url":"https://api.github.com/repos/pgmpy/pgmpy/statuses/110c1312abc21235879ae94f511635823052393b","head":{"label":"pratyakshs:mc","ref":"mc","sha":"110c1312abc21235879ae94f511635823052393b","user":{"login":"pratyakshs","id":4117104,"avatar_url":"https://avatars.githubusercontent.com/u/4117104?v=3","gravatar_id":"","url":"https://api.github.com/users/pratyakshs","html_url":"https://github.com/pratyakshs","followers_url":"https://api.github.com/users/pratyakshs/followers","following_url":"https://api.github.com/users/pratyakshs/following{/other_user}","gists_url":"https://api.github.com/users/pratyakshs/gists{/gist_id}","starred_url":"https://api.github.com/users/pratyakshs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pratyakshs/subscriptions","organizations_url":"https://api.github.com/users/pratyakshs/orgs","repos_url":"https://api.github.com/users/pratyakshs/repos","events_url":"https://api.github.com/users/pratyakshs/events{/privacy}","received_events_url":"https://api.github.com/users/pratyakshs/received_events","type":"User","site_admin":false},"repo":{"id":32227211,"name":"pgmpy","full_name":"pratyakshs/pgmpy","owner":{"login":"pratyakshs","id":4117104,"avatar_url":"https://avatars.githubusercontent.com/u/4117104?v=3","gravatar_id":"","url":"https://api.github.com/users/pratyakshs","html_url":"https://github.com/pratyakshs","followers_url":"https://api.github.com/users/pratyakshs/followers","following_url":"https://api.github.com/users/pratyakshs/following{/other_user}","gists_url":"https://api.github.com/users/pratyakshs/gists{/gist_id}","starred_url":"https://api.github.com/users/pratyakshs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pratyakshs/subscriptions","organizations_url":"https://api.github.com/users/pratyakshs/orgs","repos_url":"https://api.github.com/users/pratyakshs/repos","events_url":"https://api.github.com/users/pratyakshs/events{/privacy}","received_events_url":"https://api.github.com/users/pratyakshs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pratyakshs/pgmpy","description":"Python Library for Probabilistic Graphical Models","fork":true,"url":"https://api.github.com/repos/pratyakshs/pgmpy","forks_url":"https://api.github.com/repos/pratyakshs/pgmpy/forks","keys_url":"https://api.github.com/repos/pratyakshs/pgmpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pratyakshs/pgmpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pratyakshs/pgmpy/teams","hooks_url":"https://api.github.com/repos/pratyakshs/pgmpy/hooks","issue_events_url":"https://api.github.com/repos/pratyakshs/pgmpy/issues/events{/number}","events_url":"https://api.github.com/repos/pratyakshs/pgmpy/events","assignees_url":"https://api.github.com/repos/pratyakshs/pgmpy/assignees{/user}","branches_url":"https://api.github.com/repos/pratyakshs/pgmpy/branches{/branch}","tags_url":"https://api.github.com/repos/pratyakshs/pgmpy/tags","blobs_url":"https://api.github.com/repos/pratyakshs/pgmpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pratyakshs/pgmpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pratyakshs/pgmpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/pratyakshs/pgmpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pratyakshs/pgmpy/statuses/{sha}","languages_url":"https://api.github.com/repos/pratyakshs/pgmpy/languages","stargazers_url":"https://api.github.com/repos/pratyakshs/pgmpy/stargazers","contributors_url":"https://api.github.com/repos/pratyakshs/pgmpy/contributors","subscribers_url":"https://api.github.com/repos/pratyakshs/pgmpy/subscribers","subscription_url":"https://api.github.com/repos/pratyakshs/pgmpy/subscription","commits_url":"https://api.github.com/repos/pratyakshs/pgmpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/pratyakshs/pgmpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/pratyakshs/pgmpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/pratyakshs/pgmpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/pratyakshs/pgmpy/contents/{+path}","compare_url":"https://api.github.com/repos/pratyakshs/pgmpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pratyakshs/pgmpy/merges","archive_url":"https://api.github.com/repos/pratyakshs/pgmpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pratyakshs/pgmpy/downloads","issues_url":"https://api.github.com/repos/pratyakshs/pgmpy/issues{/number}","pulls_url":"https://api.github.com/repos/pratyakshs/pgmpy/pulls{/number}","milestones_url":"https://api.github.com/repos/pratyakshs/pgmpy/milestones{/number}","notifications_url":"https://api.github.com/repos/pratyakshs/pgmpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pratyakshs/pgmpy/labels{/name}","releases_url":"https://api.github.com/repos/pratyakshs/pgmpy/releases{/id}","created_at":"2015-03-14T18:59:21Z","updated_at":"2015-03-29T06:36:47Z","pushed_at":"2015-07-06T18:19:27Z","git_url":"git://github.com/pratyakshs/pgmpy.git","ssh_url":"git@github.com:pratyakshs/pgmpy.git","clone_url":"https://github.com/pratyakshs/pgmpy.git","svn_url":"https://github.com/pratyakshs/pgmpy","homepage":null,"size":4470,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"pgmpy:dev","ref":"dev","sha":"b82296a8ea6a1aca5c6de24e2baa6b2f9142f39f","user":{"login":"pgmpy","id":5500131,"avatar_url":"https://avatars.githubusercontent.com/u/5500131?v=3","gravatar_id":"","url":"https://api.github.com/users/pgmpy","html_url":"https://github.com/pgmpy","followers_url":"https://api.github.com/users/pgmpy/followers","following_url":"https://api.github.com/users/pgmpy/following{/other_user}","gists_url":"https://api.github.com/users/pgmpy/gists{/gist_id}","starred_url":"https://api.github.com/users/pgmpy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgmpy/subscriptions","organizations_url":"https://api.github.com/users/pgmpy/orgs","repos_url":"https://api.github.com/users/pgmpy/repos","events_url":"https://api.github.com/users/pgmpy/events{/privacy}","received_events_url":"https://api.github.com/users/pgmpy/received_events","type":"Organization","site_admin":false},"repo":{"id":12968651,"name":"pgmpy","full_name":"pgmpy/pgmpy","owner":{"login":"pgmpy","id":5500131,"avatar_url":"https://avatars.githubusercontent.com/u/5500131?v=3","gravatar_id":"","url":"https://api.github.com/users/pgmpy","html_url":"https://github.com/pgmpy","followers_url":"https://api.github.com/users/pgmpy/followers","following_url":"https://api.github.com/users/pgmpy/following{/other_user}","gists_url":"https://api.github.com/users/pgmpy/gists{/gist_id}","starred_url":"https://api.github.com/users/pgmpy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgmpy/subscriptions","organizations_url":"https://api.github.com/users/pgmpy/orgs","repos_url":"https://api.github.com/users/pgmpy/repos","events_url":"https://api.github.com/users/pgmpy/events{/privacy}","received_events_url":"https://api.github.com/users/pgmpy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pgmpy/pgmpy","description":"Python Library for Probabilistic Graphical Models","fork":false,"url":"https://api.github.com/repos/pgmpy/pgmpy","forks_url":"https://api.github.com/repos/pgmpy/pgmpy/forks","keys_url":"https://api.github.com/repos/pgmpy/pgmpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pgmpy/pgmpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pgmpy/pgmpy/teams","hooks_url":"https://api.github.com/repos/pgmpy/pgmpy/hooks","issue_events_url":"https://api.github.com/repos/pgmpy/pgmpy/issues/events{/number}","events_url":"https://api.github.com/repos/pgmpy/pgmpy/events","assignees_url":"https://api.github.com/repos/pgmpy/pgmpy/assignees{/user}","branches_url":"https://api.github.com/repos/pgmpy/pgmpy/branches{/branch}","tags_url":"https://api.github.com/repos/pgmpy/pgmpy/tags","blobs_url":"https://api.github.com/repos/pgmpy/pgmpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pgmpy/pgmpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pgmpy/pgmpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/pgmpy/pgmpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pgmpy/pgmpy/statuses/{sha}","languages_url":"https://api.github.com/repos/pgmpy/pgmpy/languages","stargazers_url":"https://api.github.com/repos/pgmpy/pgmpy/stargazers","contributors_url":"https://api.github.com/repos/pgmpy/pgmpy/contributors","subscribers_url":"https://api.github.com/repos/pgmpy/pgmpy/subscribers","subscription_url":"https://api.github.com/repos/pgmpy/pgmpy/subscription","commits_url":"https://api.github.com/repos/pgmpy/pgmpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/pgmpy/pgmpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/pgmpy/pgmpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/pgmpy/pgmpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/pgmpy/pgmpy/contents/{+path}","compare_url":"https://api.github.com/repos/pgmpy/pgmpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pgmpy/pgmpy/merges","archive_url":"https://api.github.com/repos/pgmpy/pgmpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pgmpy/pgmpy/downloads","issues_url":"https://api.github.com/repos/pgmpy/pgmpy/issues{/number}","pulls_url":"https://api.github.com/repos/pgmpy/pgmpy/pulls{/number}","milestones_url":"https://api.github.com/repos/pgmpy/pgmpy/milestones{/number}","notifications_url":"https://api.github.com/repos/pgmpy/pgmpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pgmpy/pgmpy/labels{/name}","releases_url":"https://api.github.com/repos/pgmpy/pgmpy/releases{/id}","created_at":"2013-09-20T08:18:58Z","updated_at":"2015-07-07T15:52:01Z","pushed_at":"2015-07-06T18:19:28Z","git_url":"git://github.com/pgmpy/pgmpy.git","ssh_url":"git@github.com:pgmpy/pgmpy.git","clone_url":"https://github.com/pgmpy/pgmpy.git","svn_url":"https://github.com/pgmpy/pgmpy","homepage":null,"size":6650,"stargazers_count":96,"watchers_count":96,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":48,"mirror_url":null,"open_issues_count":84,"forks":48,"open_issues":84,"watchers":96,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/pgmpy/pgmpy/pulls/442"},"html":{"href":"https://github.com/pgmpy/pgmpy/pull/442"},"issue":{"href":"https://api.github.com/repos/pgmpy/pgmpy/issues/442"},"comments":{"href":"https://api.github.com/repos/pgmpy/pgmpy/issues/442/comments"},"review_comments":{"href":"https://api.github.com/repos/pgmpy/pgmpy/pulls/442/comments"},"review_comment":{"href":"https://api.github.com/repos/pgmpy/pgmpy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pgmpy/pgmpy/pulls/442/commits"},"statuses":{"href":"https://api.github.com/repos/pgmpy/pgmpy/statuses/110c1312abc21235879ae94f511635823052393b"}}}}