package stats
import "git.dotya.ml/wanderer/math-optim/stats"
Package stats provides functions for summarizing results.
Index ¶
- func GetMeanVals(values []BenchRound, fes int) []float64
- func SaveStats(stats []Stats, fName string)
- func SaveTable(algo string, algoStats [][]Stats)
- type AlgoBenchMean
- func (a AlgoBenchMean) Len() int
- func (a AlgoBenchMean) Less(i, j int) bool
- func (a AlgoBenchMean) Swap(i, j int)
- type AlgoMeanVals
- type BenchMean
- type BenchRound
- type FuncStats
- type MeanStats
- func (m MeanStats) Len() int
- func (m MeanStats) Less(i, j int) bool
- func (m MeanStats) Swap(i, j int)
- type Stats
Functions ¶
func GetMeanVals ¶
func GetMeanVals(values []BenchRound, fes int) []float64
func SaveStats ¶
func SaveTable ¶
SaveTable sifts through computed values, organises data in table-like structure as defined in the `report` pkg and passes it on to be fed to a tmpl, result of which is then saved in a `.tex` file (filename based on the algo name string).
Types ¶
type AlgoBenchMean ¶
AlgoBenchMean holds BenchMean structs of different benchmarks but the same algorithm.
func (AlgoBenchMean) Len ¶
func (a AlgoBenchMean) Len() int
Len implements the sort.Interface.
func (AlgoBenchMean) Less ¶
func (a AlgoBenchMean) Less(i, j int) bool
Less implements the sort.Interface.
func (AlgoBenchMean) Swap ¶
func (a AlgoBenchMean) Swap(i, j int)
Swap implements the sort.Interface.
type AlgoMeanVals ¶
type AlgoMeanVals struct { Title string // MeanVals of a particular bench func to compare. MeanVals []float64 }
AlgoMeanVals holds computed mean values of an Algo.
type BenchMean ¶
type BenchMean struct { Bench string Dimens int Iterations int Generations int // Neighbours param is used in Hill Climbing type algos, set to -1 if not // applicable. Neighbours int // MeanVals holds the mean value for each step of the iteration. MeanVals []float64 }
BenchMean structure holds mean vals and metadata of a bench-params combination.
type BenchRound ¶
BenchRound holds the iteration couter value and Results of size 'maxFES'.
type FuncStats ¶
type FuncStats struct { BenchName string BenchResults []BenchRound // MeanVals holds the mean value for each step of the iteration. MeanVals []float64 }
func GetFuncStats ¶
func GetFuncStats(funcName string, benchResults []BenchRound) FuncStats
type MeanStats ¶
type MeanStats struct { AlgoMeans []AlgoBenchMean }
MeanStats aggregates AlgoMean structs of different algos.
func (MeanStats) Len ¶
Len implements the sort.Interface.
func (MeanStats) Less ¶
Less implements the sort.Interface. note: this in fact sorts in reverse (fits with our use case atm).
func (MeanStats) Swap ¶
Swap implements the sort.Interface.
type Stats ¶
type Stats struct { Algo string Dimens int BenchFuncStats []FuncStats Iterations int // this should perhaps be named FES as that is a smarter thing to be // comparing than algo generations, which can vary based on the type of // algo, number of neighbours, etc.. Generations int // NP is the initial population size, disable with 0. Only applicable to // GAs (see algo/de for more details). NP int // F is the mutation factor, disable with 0. Only applicable to GAs. F float64 // CR is the crossover probability, disable with 0. Only applicable to GAs. CR float64 }
func GetStats ¶
func GetStats(algo string, dimens int, benchFuncStats []FuncStats, iterations, generations int) Stats
Source Files ¶
doc.go stats.go table.go
- Version
- v0.0.0-20230224152531-7a5de808e98c (latest)
- Published
- Feb 24, 2023
- Platform
- linux/amd64
- Imports
- 9 packages
- Last checked
- 3 months ago –
Tools for package owners.