Documentation
¶
Overview ¶
Package experiment enables extraction of useful information from experiment objects and their formatting.
Index ¶
- func GetMetricNameAndUnits(metricInfo v2alpha2.MetricInfo) string
- func StringifyObjective(objective v2alpha2.Objective) string
- type Experiment
- func (e *Experiment) GetMetricStr(metric string, version string) string
- func (e *Experiment) GetMetricStrs(metric string) []string
- func (e *Experiment) GetSatisfyStr(objectiveIndex int, version string) string
- func (e *Experiment) GetSatisfyStrs(objectiveIndex int) []string
- func (e *Experiment) GetVersions() []string
- func (e *Experiment) Started() bool
Examples ¶
- Experiment.GetMetricStr
- Experiment.GetMetricStr (Unavailable1)
- Experiment.GetMetricStr (Unavailable2)
- Experiment.GetMetricStrs
- Experiment.GetMetricStrs (Unavailable)
- Experiment.GetSatisfyStr
- Experiment.GetSatisfyStr (Unavailable1)
- Experiment.GetSatisfyStr (Unavailable2)
- Experiment.GetSatisfyStrs
- Experiment.GetSatisfyStrs (Unavailable1)
- Experiment.GetSatisfyStrs (Unavailable2)
- Experiment.GetVersions
- Experiment.GetVersions (Empty)
- Experiment.Started (False)
- Experiment.Started (True)
- GetMetricNameAndUnits
- GetMetricNameAndUnits (Unitless)
- StringifyObjective (Lowerlimit)
- StringifyObjective (Upperandlower)
- StringifyObjective (Upperlimit)
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
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]
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
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]
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: []