https://github.com/aouyang1/go-forecaster
time-series forecasting library
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.2%) to scientific vocabulary
Keywords
Repository
time-series forecasting library
Basic Info
Statistics
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 2
- Releases: 35
Topics
Metadata Files
README.md
go-forecaster
go-forecaster is a Go library designed for time-series forecasting. It enables users to model and predict data with strong seasonal components, events, holidays, change points, and trends. The library offers functionalities for fitting forecast models, making future predictions, and visualizing results using Apache ECharts.
Features
- Model Fitting: Fit time-series data to capture trends, seasonal patterns, and events.
- Prediction: Generate forecasts for future time points based on fitted models.
- Visualization: Create interactive line charts to visualize actual data alongside forecasts and confidence intervals.
- Changepoint Detection: Identify points where the time-series data exhibits abrupt changes in trend or seasonality.
- Event Components: Incorporate and analyze the impact of specific events on the time-series data.
Examples
Contains a daily seasonal component with 2 anomalous behaviors along with 2 registered change points

Contains a daily seasonal component with a trend change point which resets

Auto-changepoint detection and fit

Installation
To install go-forecaster, use go get:
bash
go get github.com/aouyang1/go-forecaster
Usage
Here's a basic example demonstrating how to use go-forecaster: ```go package main
import ( "fmt" "time"
"github.com/aouyang1/go-forecaster"
)
func main() { // Sample time-series data times := []time.Time{...} // Your time data here values := []float64{...} // Corresponding values
// Initialize the forecaster with default options
f, err := forecaster.New(nil)
if err != nil {
fmt.Println("Error initializing forecaster:", err)
return
}
// Fit the model to the data
err = f.Fit(times, values)
if err != nil {
fmt.Println("Error fitting model:", err)
return
}
// Generate future time points for prediction
futureTimes, err := f.MakeFuturePeriods(10, 24*time.Hour)
if err != nil {
fmt.Println("Error generating future periods:", err)
return
}
// Predict future values
results, err := f.Predict(futureTimes)
if err != nil {
fmt.Println("Error making predictions:", err)
return
}
// Output the predictions
for i, t := range futureTimes {
fmt.Printf("Date: %s, Forecast: %.2f\n", t.Format("2006-01-02"), results.Forecast[i])
}
}
``
This example initializes a forecaster, fits it to sample data, and predicts future values. For more detailed examples, refer to theexamples` directory in the repository.
Visualization
go-forecaster integrates with Apache ECharts to provide interactive visualizations of your forecasts. After fitting a model, you can generate an HTML visualization:
go
// Assuming 'f' is your fitted Forecaster instance
err := f.PlotFit(outputWriter, nil)
if err != nil {
fmt.Println("Error generating plot:", err)
}
This will create an HTML file displaying the original data, the forecast, and confidence intervals.
Documentation
Comprehensive documentation is available on pkg.go.dev, detailing all available functions and types.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! If you encounter issues or have suggestions for improvements, please open an issue or submit a pull request.
Owner
- Name: Austin Ouyang
- Login: aouyang1
- Kind: user
- Location: United States
- Company: LinkedIn
- Repositories: 56
- Profile: https://github.com/aouyang1
GitHub Events
Total
- Create event: 64
- Issues event: 3
- Release event: 21
- Watch event: 2
- Delete event: 38
- Issue comment event: 90
- Push event: 103
- Pull request review comment event: 1
- Pull request review event: 2
- Pull request event: 90
Last Year
- Create event: 64
- Issues event: 3
- Release event: 21
- Watch event: 2
- Delete event: 38
- Issue comment event: 90
- Push event: 103
- Pull request review comment event: 1
- Pull request review event: 2
- Pull request event: 90
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 0
- Total pull requests: 27
- Average time to close issues: N/A
- Average time to close pull requests: 42 minutes
- Total issue authors: 0
- Total pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 1.11
- Merged pull requests: 20
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 27
- Average time to close issues: N/A
- Average time to close pull requests: 42 minutes
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 1.11
- Merged pull requests: 20
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- aouyang1 (11)
Pull Request Authors
- aouyang1 (58)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
- Total downloads: unknown
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 35
proxy.golang.org: github.com/aouyang1/go-forecaster
- Homepage: https://github.com/aouyang1/go-forecaster
- Documentation: https://pkg.go.dev/github.com/aouyang1/go-forecaster#section-documentation
- License: MIT
-
Latest release: v0.3.11
published 6 months ago
Rankings
Dependencies
- github.com/davecgh/go-spew v1.1.1
- github.com/pmezard/go-difflib v1.0.0
- github.com/sajari/regression v1.0.1
- github.com/stretchr/testify v1.9.0
- gonum.org/v1/gonum v0.15.1
- gopkg.in/yaml.v3 v3.0.1
- github.com/davecgh/go-spew v1.1.1
- github.com/pmezard/go-difflib v1.0.0
- github.com/sajari/regression v1.0.1
- github.com/stretchr/testify v1.9.0
- golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
- gonum.org/v1/gonum v0.15.1
- gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
- gopkg.in/yaml.v3 v3.0.1
- actions/checkout v4 composite
- actions/setup-go v4 composite