utils

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Avg

func Avg(data []float64) float64

func ChangeDimension

func ChangeDimension(sourceMatrix map[string][]int64, oldStats models.TSStats, newStats models.TSStats, states int) map[string][]int64

ChangeDimension transforms the given sourceMatrix from stats oldStats to the new shape specified in newStats

func ClosestDiscretize

func ClosestDiscretize(value float64, maxstate int, min float64, max float64) models.State

ClosestDiscretize returns a state between min and max with maxstate steps of given value, finding the closest state

func ComputeProbabilities

func ComputeProbabilities(statematrix map[string][]int64, maxCount float64) map[string]models.TXStep

func HistoryStateAsString

func HistoryStateAsString(previousState []models.State) string

HistoryStateAsString returns the given state history as a string

func IsOutlier

func IsOutlier(value float64, avg float64, stddev float64, filterStddev int) bool

func Max

func Max(v []float64) float64

func Min

func Min(v []float64) float64

func ReadProfileFromFile

func ReadProfileFromFile(filepath string) models.TSProfile

ReadProfileFromFile returns the TSProfile model read from the given json file

func Round

func Round(x float64) float64

func SimpleDiscretize

func SimpleDiscretize(value float64, maxstate int, min float64, max float64) models.State

SimpleDiscretize returns a state between min and max with maxstate steps of given value finding the smallest state

func Stddev

func Stddev(data []float64) float64

func Sum

func Sum(data []int64) int64

Types

This section is empty.

Jump to

Keyboard shortcuts

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