repositorypackage
0.3.5
Repository: https://github.com/aouyang1/go-forecaster.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# README
go-forecaster
forecasting library
Example 1
Contains a daily seasonal component with 2 anomalous behaviors along with 2 registered change points
Example 2
Contains a daily seasonal component with a trend change point which resets
Example 3
Auto-changepoint detection and fit
Example Use
import (
"fmt"
"time"
"github.com/aouyang1/go-forecaster"
)
func MyForecast(t []time.Time, y []float64) ([]float64, error) {
// initialize forecaster
f, err := forecaster.New(nil)
if err != nil {
return nil, err
}
// fit the model
if err := f.Fit(t, y); err != nil {
return nil, err
}
// create future time slice with 10 samples after last training time at minute level
// granularity
horizon, err := f.MakeFuturePeriods(10, time.Minute)
if err != nil {
return nil, err
}
return f.Predict(horizon)
}