config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 1 Imported by: 0

README

config

Package config holds global configuration defaults for datascience, providing thread-safe access to shared settings.

Import path: github.com/asymmetric-effort/datascience/lib/pgm/config

Types

Config
type Config struct {
    DefaultInferenceMethod string  // e.g., "variable_elimination", "belief_propagation"
    DefaultSignificance    float64 // default significance level for CI tests (default: 0.05)
    Verbose                bool    // enable verbose logging (default: false)
    Seed                   int64   // default random seed; 0 means use random seed
}

Functions

Function Description
GetDefault() Return a copy of the current global configuration (thread-safe)
SetDefault(cfg) Replace the global configuration (thread-safe)

Default Values

Field Default
DefaultInferenceMethod "variable_elimination"
DefaultSignificance 0.05
Verbose false
Seed 0

Usage

import "github.com/asymmetric-effort/datascience/lib/pgm/config"

// Read current defaults
cfg := config.GetDefault()
fmt.Println(cfg.DefaultSignificance) // 0.05

// Update defaults
cfg.Verbose = true
cfg.DefaultInferenceMethod = "belief_propagation"
cfg.Seed = 42
config.SetDefault(cfg)

// Access the package-level variable directly (not thread-safe)
fmt.Println(config.Default.Verbose)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = current

Default is the package-level default configuration. Use GetDefault/SetDefault for thread-safe access.

Functions

func SetDefault

func SetDefault(cfg Config)

SetDefault replaces the global default configuration.

Types

type Config

type Config struct {
	// DefaultInferenceMethod is the name of the default inference algorithm
	// (e.g. "variable_elimination", "belief_propagation").
	DefaultInferenceMethod string

	// DefaultSignificance is the default significance level for statistical
	// tests (e.g. conditional independence tests).
	DefaultSignificance float64

	// Verbose controls whether verbose logging is enabled.
	Verbose bool

	// Seed is the default random seed. A value of 0 means use a random seed.
	Seed int64
}

Config holds global configuration defaults for datascience.

func GetDefault

func GetDefault() Config

GetDefault returns a copy of the current global default configuration.

Jump to

Keyboard shortcuts

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