stepfit

package
v0.0.0-...-6bef223 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: BSD-3-Clause Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const InvalidLeastSquaresError = -1

InvalidLeastSquaresError signals that the value of StepFit.LeastSquares is invalid, i.e. it is not calculated for the given algorithm.

Variables

View Source
var AllStepFitStatus = []StepFitStatus{LOW, HIGH, UNINTERESTING}

AllStepFitStatus is the list of all StepFitStatus values.

Functions

This section is empty.

Types

type StepFit

type StepFit struct {
	// LeastSquares is the Least Squares error for a step function curve fit to
	// the trace. Will be set to InvalidLeastSquaresError if LSE isn't
	// calculated for a given algorithm.
	LeastSquares float32 `json:"least_squares"`

	// TurningPoint is the index where the Step Function changes value.
	TurningPoint int `json:"turning_point"`

	// StepSize is the size of the step in the step function. Negative values
	// indicate a step up, i.e. they look like a performance regression in the
	// trace, as opposed to positive values which look like performance
	// improvements.
	StepSize float32 `json:"step_size"`

	// The "Regression" value is calculated as Step Size / Least Squares Error.
	//
	// The better the fit the larger the number returned, because LSE
	// gets smaller with a better fit. The higher the Step Size the
	// larger the number returned.
	Regression float32 `json:"regression"`

	// Status of the cluster.
	//
	// Values can be "High", "Low", and "Uninteresting"
	Status StepFitStatus `json:"status"`
}

StepFit stores information on the best Step Function fit on a trace.

Used in ClusterSummary.

func GetStepFitAtMid

func GetStepFitAtMid(trace []float32, stddevThreshold float32, interesting float32, stepDetection types.StepDetection) *StepFit

GetStepFitAtMid takes one []float32 trace and calculates and returns a *StepFit.

stddevThreshold is the minimum standard deviation allowed when normalizing traces to a standard deviation of 1.

interesting is the threshold for a particular step to be flagged as a regression.

stepDetection is the algorithm to use to test for a regression.

See StepFit for a description of the values being calculated.

func NewStepFit

func NewStepFit() *StepFit

NewStepFit creates an properly initialized StepFit struct.

type StepFitStatus

type StepFitStatus string

StepFitStatus is the status of the StepFit.

const (

	// LOW is a step down.
	LOW StepFitStatus = "Low"

	// HIGH is a step up.
	HIGH StepFitStatus = "High"

	// UNINTERESTING means no step occurred.
	UNINTERESTING StepFitStatus = "Uninteresting"
)

Jump to

Keyboard shortcuts

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