experiment

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package experiment enables extraction of useful information from experiment objects and their formatting.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMetricNameAndUnits

func GetMetricNameAndUnits(metricInfo v2alpha2.MetricInfo) string

GetMetricNameAndUnits extracts the name, and if specified, units for the given metricInfo object and combines them into a string.

Example
Output:

height (inches)
Example (Unitless)
Output:

weight

func StringifyObjective

func StringifyObjective(objective v2alpha2.Objective) string

StringifyObjective returns a string representation of the given objective.

Example (Lowerlimit)
Output:

0.998 <= accuracy
Example (Upperandlower)
Output:

6.998 <= pH level <= 7.012
Example (Upperlimit)
Output:

error-rate <= 0.010

Types

type Experiment

type Experiment struct {
	v2alpha2.Experiment
}

Experiment is an enhancement of v2alpha2.Experiment struct, and supports various methods used in describing an experiment.

func (*Experiment) GetMetricStr

func (e *Experiment) GetMetricStr(metric string, version string) string

GetMetricStr returns the metric value as a string for a given metric and a given version.

Example
Output:

197.500
Example (Unavailable1)
Output:

unavailable
Example (Unavailable2)
Output:

unavailable

func (*Experiment) GetMetricStrs

func (e *Experiment) GetMetricStrs(metric string) []string

GetMetricStrs returns the given metric's value as a slice of strings, whose elements correspond to versions.

Example
Output:

[228.788 197.500]
Example (Unavailable)
Output:

[unavailable unavailable]

func (*Experiment) GetSatisfyStr

func (e *Experiment) GetSatisfyStr(objectiveIndex int, version string) string

GetSatisfyStr returns a true/false/unavailable valued string denotating if a version satisfies the objective.

Example
Output:

true
Example (Unavailable1)
Output:

unavailable
Example (Unavailable2)
Output:

unavailable

func (*Experiment) GetSatisfyStrs

func (e *Experiment) GetSatisfyStrs(objectiveIndex int) []string

GetSatisfyStrs returns a slice of true/false/unavailable valued strings for an objective denoting if it is satisfied by versions.

Example
Output:

[true true]
Example (Unavailable1)
Output:

[]
Example (Unavailable2)
Output:

[unavailable unavailable]

func (*Experiment) GetVersions

func (e *Experiment) GetVersions() []string

GetVersions returns the slice of version name strings. If the VersionInfo section is not present in the experiment's spec, then this slice is empty.

Example
Output:

[default canary]
Example (Empty)
Output:

[]

func (*Experiment) Started

func (e *Experiment) Started() bool

Started indicates if at least one iteration of the experiment has completed.

Example (False)
Output:

false
Example (True)
Output:

true

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳