bayes

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Network

type Network struct {
	// contains filtered or unexported fields
}

func LoadAsset

func LoadAsset(name string) (*Network, error)

func LoadBytes

func LoadBytes(name string, data []byte) (*Network, error)

func (*Network) GenerateConsistentSample

func (n *Network) GenerateConsistentSample(possibilities map[string][]string, rng RNG) (map[string]string, bool)

func (*Network) GenerateSample

func (n *Network) GenerateSample(input map[string]string, rng RNG) map[string]string

func (*Network) Node

func (n *Network) Node(name string) (*Node, bool)

func (*Network) Nodes

func (n *Network) Nodes() []*Node

func (*Network) PossibleValues

func (n *Network) PossibleValues(name string) []string

func (*Network) PossibleValuesFromConstraints

func (n *Network) PossibleValuesFromConstraints(possibilities map[string][]string) (map[string][]string, error)

type Node

type Node struct {
	// contains filtered or unexported fields
}

func (*Node) Name

func (n *Node) Name() string

func (*Node) ParentNames

func (n *Node) ParentNames() []string

func (*Node) PossibleValues

func (n *Node) PossibleValues() []string

func (*Node) Probabilities

func (n *Node) Probabilities(parentValues map[string]string) map[string]float64

func (*Node) Sample

func (n *Node) Sample(parentValues map[string]string, rng RNG) string

func (*Node) SampleRestricted

func (n *Node) SampleRestricted(parentValues map[string]string, possibilities []string, banned map[string]struct{}, rng RNG) (string, bool)

type RNG

type RNG interface {
	Float64() float64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL