|
| 1 | +using Microsoft.ML.Runtime; |
| 2 | +using Microsoft.ML.Runtime.Data; |
| 3 | +using System; |
| 4 | +using System.Collections.Generic; |
| 5 | +using System.Text; |
| 6 | + |
| 7 | +namespace Microsoft.ML.TimeSeries |
| 8 | +{ |
| 9 | + /// <summary> |
| 10 | + /// Interface for forecasting models. |
| 11 | + /// </summary> |
| 12 | + /// <typeparam name="T">The type of values that are forecasted.</typeparam> |
| 13 | + public interface ICanForecast<out T> |
| 14 | + { |
| 15 | + /// <summary> |
| 16 | + /// Train a forecasting model from an <see cref="IDataView"/>. |
| 17 | + /// </summary> |
| 18 | + /// <param name="dataView">Reference to the <see cref="IDataView"/></param> |
| 19 | + /// <param name="inputColumnName">Name of the input column to train the forecasing model.</param> |
| 20 | + void Train(IDataView dataView, string inputColumnName); |
| 21 | + |
| 22 | + /// <summary> |
| 23 | + /// Update a forecasting model with the new observations in the form of an <see cref="IDataView"/>. |
| 24 | + /// </summary> |
| 25 | + /// <param name="dataView">Reference to the observations as an <see cref="IDataView"/></param> |
| 26 | + /// <param name="inputColumnName">Name of the input column to update from.</param> |
| 27 | + void Update(IDataView dataView, string inputColumnName); |
| 28 | + |
| 29 | + /// <summary> |
| 30 | + /// Perform forecasting until a particular <paramref name="horizon"/>. |
| 31 | + /// </summary> |
| 32 | + /// <param name="horizon">Number of values to forecast.</param> |
| 33 | + /// <returns></returns> |
| 34 | + T[] Forecast(int horizon); |
| 35 | + |
| 36 | + /// <summary> |
| 37 | + /// Serialize the forecasting model to disk to preserve the state of forecasting model. |
| 38 | + /// </summary> |
| 39 | + /// <param name="env">Reference to <see cref="IHostEnvironment"/>, typically <see cref="MLContext"/></param> |
| 40 | + /// <param name="filePath">Name of the filepath to serialize the model to.</param> |
| 41 | + void Checkpoint(IHostEnvironment env, string filePath); |
| 42 | + |
| 43 | + /// <summary> |
| 44 | + /// Deserialize the forecasting model from disk. |
| 45 | + /// </summary> |
| 46 | + /// <param name="env">Reference to <see cref="IHostEnvironment"/>, typically <see cref="MLContext"/></param> |
| 47 | + /// <param name="filePath">Name of the filepath to deserialize the model from.</param> |
| 48 | + ICanForecast<T> LoadFrom(IHostEnvironment env, string filePath); |
| 49 | + } |
| 50 | +} |
0 commit comments