How to use the pomegranate.BayesianNetwork.from_samples function in pomegranate

To help you get started, we’ve selected a few pomegranate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DAI-Lab / SDGym / synthetic_data_benchmark / synthesizer / clbn_synthesizer.py View on Github external
def train(self, train_data):
        self.discretizer = DiscretizeTransformer(self.meta, 8)
        self.discretizer.fit(train_data)
        train_data_d = self.discretizer.transform(train_data)
        self.model = BayesianNetwork.from_samples(train_data_d, algorithm='chow-liu')
github DAI-Lab / SDGym / sdgym / synthesizers / clbn.py View on Github external
def fit(self, data, categoricals=tuple(), ordinals=tuple()):
        self.discretizer = DiscretizeTransformer(n_bins=15)
        self.discretizer.fit(data, categoricals, ordinals)
        discretized_data = self.discretizer.transform(data)
        self.model = BayesianNetwork.from_samples(discretized_data, algorithm='chow-liu')