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}

After Change


            for j, (var, st) in enumerate(self.state):
                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):
        
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

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: pgmpy/pgmpy
Commit Name: c7937882fce356c540e526f3eb690b304f83c9d7
Time: 2015-08-15
Author: pratyaksh@me.com
File Name: pgmpy/models/MarkovChain.py
Class Name: MarkovChain
Method Name: sample


Project Name: ShangtongZhang/reinforcement-learning-an-introduction
Commit Name: ff8cc9e75f5ddb1473efff36d3f33c092d98391a
Time: 2018-08-05
Author: zhangshangtong.cpp@icloud.com
File Name: chapter01/TicTacToe.py
Class Name: Judger
Method Name: play