1
|
//
|
2
|
// Author: Roman Kalivoda
|
3
|
//
|
4
|
|
5
|
using System;
|
6
|
using System.Collections.Generic;
|
7
|
using System.Linq;
|
8
|
using System.Text;
|
9
|
using System.Threading.Tasks;
|
10
|
using Microsoft.ML;
|
11
|
using Microsoft.ML.Data;
|
12
|
|
13
|
|
14
|
namespace ServerApp.Predictor
|
15
|
{
|
16
|
/// <summary>
|
17
|
/// A predictor interface.
|
18
|
/// </summary>
|
19
|
public interface IPredictor
|
20
|
{
|
21
|
/// <summary>
|
22
|
/// Trains the predictor with the given training data input.
|
23
|
/// </summary>
|
24
|
/// <param name="trainInput">A collection of <c>ModelInput</c> instances. The objects contain both feature vector inputs and corresponding labels.</param>
|
25
|
void Fit(IEnumerable<ModelInput> trainInput);
|
26
|
|
27
|
/// <summary>
|
28
|
/// Predicts classes to the given feature vectors.
|
29
|
/// </summary>
|
30
|
/// <param name="input">A collection of model feature vectors in <c>ModelInput</c> instances.</param>
|
31
|
/// <returns>A collection of <c>PredictionResult</c> instances.</returns>
|
32
|
IDataView Predict(IEnumerable<ModelInput> input);
|
33
|
|
34
|
// TODO define Save method
|
35
|
}
|
36
|
}
|