Forecast API is a REST service for making time-series forecasting. It is suitable for making forecasts that exhibit daily, weekly and yearly seasonalities. Trends through time can also be detected. For example you can use it to forecast number of webpage views for the coming week given data for the past month.
Run the forecast-api docker image and make a rest call to get forecasts
docker run --name forecast-api -p=9072:8080 vidible/forecast-api:2.0.3
curl -X POST -H "Content-Type: application/json" -d '{ "timeSeries": [ 0, 1, 2, 3, 2, 1, 0, 0, 1, 2, 3, 2, 1, 0, 0 ], "numberForecasts": 7 }' "http://localhost:9072/forecast-api/forecast"
Expected response
{
"forecast" : [ 1.0, 2.0, 3.0, 2.0, 1.0, 0.0, 0.0 ],
"selectedCannedSet" : "RW-NONE-WEEK",
"time" : 68
}
Here are some forecast scenarios. Solid line shows historical data and dotted lines are forecasts.
Forecast-API comes with a java based client. It should be straightforward to write a simple REST client for other languages.
"com.aol.one.reporting" % "forecast-api-client" % INSERT_LATEST_VERSION
<dependency>
<groupId>com.aol.one.reporting</groupId>
<artifactId>forecast-api-client_2.11</artifactId>
<version>INSERT_LATEST_VERSION</version>
</dependency>
Example below provides a timeseries with 14 data points and requests forecast for the next 7 data points:
val client = new ForecastClientImpl("http://localhost:9072/forecast-api/forecast")
val forecast = client.forecast(Array(1, 2, 3, 4, 3, 2, 1, 1, 2, 3, 4, 3, 2, 1), 7)
- Forecast API makes use of a few algorithms including ARIMA, Regression and exponential smoothing. Head over to the wiki to learn more.
- Swagger docs can be found at http://localhost:9072/forecast-api.
Server:
cd server
mvn install
Client:
cd client
sbt compile
- Alexey Lipodat
- Paul Eldreth
- Sergey Likhoman
- Terry Choi
- Tilaye Y. Alemu
- Venkata Vittala
Forecast API is released under the Apache License, Version 2.0