c7937882fce356c540e526f3eb690b304f83c9d7,pgmpy/models/MarkovChain.py,MarkovChain,generate_sample,#MarkovChain#Any#Any#,287

Before Change


        // sampled.loc[0] = [self.state[var] for var in self.variables]
        for i in range(size):
            for var in self.variables:
                val = self.state[var]
                next_val = sample_discrete(list(self.transition_models[var][val].keys()),
                                           list(self.transition_models[var][val].values()))[0]
                self.state[var] = next_val
            yield {var: self.state[var] for var in self.variables}

    def random_state(self):
        
        Generates a random state of the Markov Chain.

After Change


                next_st = sample_discrete(list(self.transition_models[var][st].keys()),
                                          list(self.transition_models[var][st].values()))[0]
                self.state[j] = State(var, next_st)
            yield self.state[:]

    def random_state(self):
        
        Generates a random state of the Markov Chain.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: pgmpy/pgmpy
Commit Name: c7937882fce356c540e526f3eb690b304f83c9d7
Time: 2015-08-15
Author: pratyaksh@me.com
File Name: pgmpy/models/MarkovChain.py
Class Name: MarkovChain
Method Name: generate_sample


Project Name: facebookresearch/pytext
Commit Name: ea51cc011a7802bc35f52c64745230a4155cb352
Time: 2019-05-06
Author: chenyangyu@instagram.com
File Name: pytext/data/data.py
Class Name:
Method Name: pad_and_tensorize_batches


Project Name: BVLC/caffe
Commit Name: 5d584c27f062e9557aa920af6758b995f4094ed9
Time: 2014-05-16
Author: shelhamer@imaginarynumber.net
File Name: python/caffe/pycaffe.py
Class Name:
Method Name: _Net_batch