005cd59c9327b7376cd5140ea5f0435620964669,pgmpy/inference/Sampling.py,BayesianModelSampling,__init__,#BayesianModelSampling#,32

Before Change


            raise TypeError("model must an instance of BayesianModel")
        super(BayesianModelSampling, self).__init__(model)
        self.topological_order = nx.topological_sort(model)
        self.cpds = {node: model.get_cpds(node) for node in model.nodes()}

    def forward_sample(self, size=1):
        
        Generates sample(s) from joint distribution of the bayesian network.

After Change


    
    def __init__(self, model):
        if not isinstance(model, BayesianModel):
            raise TypeError("Model expected type: BayesianModel, got type: ", type(model))

        self.topological_order = nx.topological_sort(model)
        super(BayesianModelSampling, self).__init__(model)
        // self.cpds = {node: model.get_cpds(node) for node in model.nodes()}
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: pgmpy/pgmpy
Commit Name: 005cd59c9327b7376cd5140ea5f0435620964669
Time: 2015-11-17
Author: ankurankan@gmail.com
File Name: pgmpy/inference/Sampling.py
Class Name: BayesianModelSampling
Method Name: __init__


Project Name: pgmpy/pgmpy
Commit Name: 73dcacffa7dee910a9478cd7d783d91ef84dc987
Time: 2013-09-21
Author: snigam3112@gmail.com
File Name: BayesianModel.py
Class Name: BayesianModel
Method Name: add_nodes


Project Name: has2k1/plotnine
Commit Name: 26e44fb488bd8ab2c504f39e2ca0eeba93329763
Time: 2020-10-06
Author: has2k1@gmail.com
File Name: plotnine/geoms/geom_map.py
Class Name: geom_map
Method Name: draw_panel