Documentation
¶
Index ¶
- Constants
- type Changepoint
- type ChangepointComp
- type Data
- type Feature
- type FeatureType
- type FourierComp
- type Seasonality
- type Set
- func (s *Set) Del(f Feature)
- func (s *Set) Get(f Feature) (Data, bool)
- func (s *Set) Labels() []Feature
- func (s *Set) Len() int
- func (s *Set) Matrix(intercept bool) *mat.Dense
- func (s *Set) MatrixSlice(intercept bool) [][]float64
- func (s *Set) Set(f Feature, data Data)
- func (s *Set) Update(other *Set)
- type Time
Constants ¶
const ( ChangepointCompBias = "bias" ChangepointCompSlope = "slope" )
const ( FourierCompSin = "sin" FourierCompCos = "cos" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Changepoint ¶
type Changepoint struct { Name string `json:"name"` ChangepointComp ChangepointComp `json:"changepoint_component"` }
Changepoint feature representing a point in time that we expect a jump or trend change in the training time series. The component is either of type bias (jump) or slope (trend).
func NewChangepoint ¶
func NewChangepoint(name string, comp ChangepointComp) *Changepoint
NewChangepoint creates a new changepoint instance given a name and changepoint component type
func (Changepoint) Decode ¶
func (c Changepoint) Decode() map[string]string
Decode converts the feature into a map of label values
func (Changepoint) Get ¶
func (c Changepoint) Get(label string) (string, bool)
Get returns the value of an arbitrary label annd returns the value along with whether the label exists
func (Changepoint) String ¶
func (c Changepoint) String() string
String returns the string representation of the changepoint feature
func (Changepoint) Type ¶
func (c Changepoint) Type() FeatureType
Type returns the type of this feature
func (*Changepoint) UnmarshalJSON ¶
func (c *Changepoint) UnmarshalJSON(data []byte) error
UnmarshalJSON is the custom unmarshalling to convert a map[string]string to a changepoint feature
type ChangepointComp ¶
type ChangepointComp string
type Data ¶ added in v0.1.0
FeatureData represents a feature type with is associated observed values
type Feature ¶
type Feature interface { // String returns the string representation of the feature String() string // Get returns the value of an arbitrary label annd returns the value along with whether // the label exists Get(string) (string, bool) // Type returns the type of this feature Type() FeatureType // Decode converts the feature into a map of label values Decode() map[string]string // UnmarshalJSON is the custom unmarshalling to convert a map[string]string // to a feature UnmarshalJSON([]byte) error }
Feature is an interface representing a type of feature e.g. changepoint, seasonality, or time
type FeatureType ¶
type FeatureType string
const ( FeatureTypeChangepoint FeatureType = "changepoint" FeatureTypeSeasonality FeatureType = "seasonality" FeatureTypeTime FeatureType = "time" )
type FourierComp ¶
type FourierComp string
type Seasonality ¶
type Seasonality struct { Name string `json:"name"` FourierComp FourierComp `json:"fourier_component"` Order int `json:"order"` }
Seasonality feature representing a single seasonality component. A seasonality component consists of a name, component (sin or cos), and order (fourier order).
func NewSeasonality ¶
func NewSeasonality(name string, fcomp FourierComp, order int) *Seasonality
NewSeasonality creates a new seasonality feature instance givenn a name, sin/cos component, and Fourier order
func (Seasonality) Decode ¶
func (s Seasonality) Decode() map[string]string
Decode converts the feature innto a map of label values
func (Seasonality) Get ¶
func (s Seasonality) Get(label string) (string, bool)
Get returns the value of an arbitrary label and returns the value along with whether the label exists
func (Seasonality) String ¶
func (s Seasonality) String() string
String returns the string representation of the seasonality feature
func (Seasonality) Type ¶
func (s Seasonality) Type() FeatureType
Type returns the type of this feature
func (*Seasonality) UnmarshalJSON ¶
func (s *Seasonality) UnmarshalJSON(data []byte) error
UnmarshalJSON is the custom unmarshalling to convert a map[string]string to a seasonality feature
type Set ¶ added in v0.1.0
type Set struct {
// contains filtered or unexported fields
}
Set represents a mapping to each feature data keyed by the string representation of the feature.
func (*Set) Labels ¶ added in v0.1.0
Labels returns the sorted slice of all tracked features in the FeatureSet
func (*Set) Matrix ¶ added in v0.1.0
Matrix returns a metric representation of the FeatureSet to be used with matrix methods The matrix has m rows representing the number of observations and n columns representing the number of features.
func (*Set) MatrixSlice ¶ added in v0.1.0
MatrixSlice returns the FeatureSet as a matrix but in the form of a slice of slices where each row represent feature. Takes an intercept input if we want to include the intercept term.
type Time ¶
type Time struct {
Name string `json:"name"`
}
Time feature representing a time based feature e.g. hour of day.
func (Time) Get ¶
Get returns the value of an arbitrary label annd returns the value along with whether the label exists
func (*Time) UnmarshalJSON ¶
UnmarshalJSON is the custom unmarshalling to convert a map[string]string to a time feature