heuristic

package
v0.1.0-dev3 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(buckets []Bucket, valueFunc ValueFunc, scope tally.Scope) scorer.Scorer

New creates a new heuristic Scorer with the given buckets and value function. Panics if valueFunc is nil.

Types

type Bucket

type Bucket struct {
	// Min is the inclusive lower bound of the range.
	Min int
	// Max is the inclusive upper bound of the range.
	Max int
	// Score is the probability returned when the metric falls within this bucket.
	Score float64
}

Bucket defines a range [Min, Max] mapped to a probability Score.

type ValueFunc

type ValueFunc func(context.Context, entity.Change) (int, error)

ValueFunc extracts a single numeric value from a Change for bucketing.

Jump to

Keyboard shortcuts

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