Categorygithub.com/aouyang1/go-forecaster
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

Go Report Card codecov GoDoc License

Example 1

Contains a daily seasonal component with 2 anomalous behaviors along with 2 registered change points Forecast Example

Example 2

Contains a daily seasonal component with a trend change point which resets Forecast With Trend Example

Example 3

Auto-changepoint detection and fit Forecast With Auto-Changepoint Detection Example

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)
}