Documentation ¶
Index ¶
- Constants
- type Changepoint
- type ChangepointComp
- type Event
- type Feature
- type FeatureType
- type FourierComp
- type Seasonality
- type Set
- func (s *Set) Del(f Feature) *Set
- func (s *Set) Get(f Feature) ([]float64, bool)
- func (s *Set) Labels() []Feature
- func (s *Set) Len() int
- func (s *Set) Matrix(intercept bool) *mat.Dense
- func (s *Set) RemoveZeroOnlyFeatures()
- func (s *Set) Set(f Feature, data []float64) *Set
- func (s *Set) Update(other *Set) *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 Event ¶ added in v0.2.11
type Event struct {
Name string `json:"name"`
}
Event 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 (Event) Get ¶ added in v0.2.11
Get returns the value of an arbitrary label annd returns the value along with whether the label exists
func (Event) String ¶ added in v0.2.11
String returns the string representation of the event feature
func (Event) Type ¶ added in v0.2.11
func (e Event) Type() FeatureType
Type returns the type of this feature
func (*Event) UnmarshalJSON ¶ added in v0.2.11
UnmarshalJSON is the custom unmarshalling to convert a map[string]string to a event feature
type Feature ¶
type Feature interface { // String returns the string representation of the feature String() string // Get returns the value of an arbitrary label and 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" FeatureTypeEvent FeatureType = "event" )
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) Del ¶ added in v0.2.0
Del will attempt to remove an existing feature from the set. If there are no more features stored, the data length will be reset to 0 and will be initialized on the next Set call.
func (*Set) Get ¶ added in v0.2.0
Get retrieves the values of a particular feature. This returns an extra bool to indicate if the feature exists in the set or not.
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) RemoveZeroOnlyFeatures ¶ added in v0.2.11
func (s *Set) RemoveZeroOnlyFeatures()
RemoveZeroOnlyFeatures scans through all features and removes any features with only zero values. This is to prevent fitting issues.
func (*Set) Set ¶ added in v0.2.0
Set will store the input feature with the input slice of values. This will zero pad out the data if it is less than the current data length of the set. If it is larger, all other features will be zero padded.
func (*Set) Update ¶ added in v0.2.0
Update will merge an input set with the existing set. If the data length of the input is less than the existing, the input is zero padded out to match. If the data length of the input is greater than the existing, the existing is zero padded out to match. Any overlapping keys will result in a replacement.
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