|
GettingStarted
Complete sample snippet for the .NET Forecasting Client
Featured Getting started with the .NET Forecasting ClientThis page details the usage of the Lokad .NET Forecasting Client, a .NET wrapper around the Lokad Forecasting API. Check the API page for in-depth explanations of the API concepts. Pre-requisiteGo to the downloads and get the Lokad Forecasting Client. This SDK comes as a single stand-alone DLL named Lokad.Forecasting.Client.dll. You need to add this DLL to your .NET project in Visual Studio, and add an extra DLL reference too. Data caveats
Sample snippet for the .NET Forecasting ClientThe C# code snippet below illustrate how to upload and retrieve forecasts with the Lokad.Forecasting.Client.dll. using Lokad.Forecasting.Client;
namespace MyCompany
{
class Program
{
static void Main(string[] args)
{
var client = new ForecastingClient("ENTER_YOUR_FORECASTING_KEY_HERE");
// Create a new dataset (no effect if it exists already)
var container = new Dataset {
Name = "sales",
Period = "month",
Horizon = 6
};
client.InsertDataset(container);
// Update or Insert time-series
var series = new TimeSerie[] { /* snipped */ };
client.UpsertTimeSeries("sales", series, false); // merge=false
// Wait until forecasts are ready, and then download forecasts
var forecasts = client.GetForecasts("sales", series);
}
}
|
► Sign in to add a comment
cannot convert from 'Lokad.Forecasting.Client.TimeSerie?' to 'string' for this code "var forecasts = client.GetForecasts?("sales", series); "