Skip to content

Commit b486f1e

Browse files
committed
Comments.
1 parent 168259b commit b486f1e

File tree

2 files changed

+37
-4
lines changed

2 files changed

+37
-4
lines changed

src/Microsoft.ML.TimeSeries/AdaptiveSingularSpectrumSequenceModeler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1595,7 +1595,7 @@ public void Checkpoint(IHostEnvironment env, string filePath)
15951595
}
15961596
}
15971597

1598-
public AdaptiveSingularSpectrumSequenceModeler LoadFrom(IHostEnvironment env, string filePath)
1598+
public ICanForecast<float> LoadFrom(IHostEnvironment env, string filePath)
15991599
{
16001600
using (var file = File.OpenRead(filePath))
16011601
{

src/Microsoft.ML.TimeSeries/PredictionFunction.cs

+36-3
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,46 @@
1111

1212
namespace Microsoft.ML.Transforms.TimeSeries
1313
{
14-
internal interface ICanForecast<out T>
14+
/// <summary>
15+
/// Interface for forecasting models.
16+
/// </summary>
17+
/// <typeparam name="T">The type of values that are forecasted.</typeparam>
18+
public interface ICanForecast<out T>
1519
{
20+
/// <summary>
21+
/// Train a forecasting model from an <see cref="IDataView"/>.
22+
/// </summary>
23+
/// <param name="dataView">Reference to the <see cref="IDataView"/></param>
24+
/// <param name="inputColumnName">Name of the input column to train the forecasing model.</param>
1625
void Train(IDataView dataView, string inputColumnName);
17-
T[] Forecast(int horizon);
26+
27+
/// <summary>
28+
/// Update a forecasting model with the new observations in the form of an <see cref="IDataView"/>.
29+
/// </summary>
30+
/// <param name="dataView">Reference to the observations as an <see cref="IDataView"/></param>
31+
/// <param name="inputColumnName">Name of the input column to update from.</param>
1832
void Update(IDataView dataView, string inputColumnName);
33+
34+
/// <summary>
35+
/// Perform forecasting until a particular <paramref name="horizon"/>.
36+
/// </summary>
37+
/// <param name="horizon">Number of values to forecast.</param>
38+
/// <returns></returns>
39+
T[] Forecast(int horizon);
40+
41+
/// <summary>
42+
/// Serialize the forecasting model to disk to preserve the state of forecasting model.
43+
/// </summary>
44+
/// <param name="env">Reference to <see cref="IHostEnvironment"/>, typically <see cref="MLContext"/></param>
45+
/// <param name="filePath">Name of the filepath to serialize the model to.</param>
1946
void Checkpoint(IHostEnvironment env, string filePath);
20-
AdaptiveSingularSpectrumSequenceModeler LoadFrom(IHostEnvironment env, string filePath);
47+
48+
/// <summary>
49+
/// Deserialize the forecasting model from disk.
50+
/// </summary>
51+
/// <param name="env">Reference to <see cref="IHostEnvironment"/>, typically <see cref="MLContext"/></param>
52+
/// <param name="filePath">Name of the filepath to deserialize the model from.</param>
53+
ICanForecast<T> LoadFrom(IHostEnvironment env, string filePath);
2154
}
2255

2356
internal interface IStatefulRowToRowMapper : IRowToRowMapper

0 commit comments

Comments
 (0)