/kbn

Learn probabilistic models with hidden variables in a k-tree structure

Primary LanguageGo

sampling hidden models

learn bounded tree-width probabilistic models with hidden variables via k-tree sampling

Build Status Coverage Status Go Report Card GoDoc


Installation and usage

Get, install and test:

	go get -u github.com/britojr/kbn...
	go install github.com/britojr/kbn...
	go test github.com/britojr/kbn... -cover

Usage:

	kbn --help
	Usage: kbn <command> [options]

	Commands:

		struct		sample bounded tree-width structure
		param		parameter learning using expectation-maximization
		marginals	compute marginal distribution for each variable in the model

	To see details of each command:

		kbn <command> --help

Examples:

	# move to examples directory
	cd examples/

	# sample a structure with tree-width 4 and 10 latent variables
	kbn struct -d example.csv -cs example-struct.ct0 -k 4 -h 10

	# learn parameters
	kbn param -dist rand -mode indep -cl example-struct.ct0 -cs example-struct.ctp -d example.csv

	# compute marginals
	kbn marginals -c example-struct.ctp -m example.mar