forked from dotnet/machinelearning
/
IPredictionTransformer.cs
49 lines (44 loc) · 2.39 KB
/
IPredictionTransformer.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Microsoft.ML.Calibrators;
using Microsoft.ML.Data;
namespace Microsoft.ML
{
/// <summary>
/// An interface for all the transformer that can transform data based on the <see cref="IPredictor"/> field.
/// The implementations of this interface either have no feature column, or have more than one feature column, and cannot implement the
/// <see cref="ISingleFeaturePredictionTransformer{TModel}"/>, which most of the ML.Net tranformer implement.
/// </summary>
/// <typeparam name="TModel">The <see cref="IPredictor"/> or <see cref="ICalibrator"/> used for the data transformation.</typeparam>
public interface IPredictionTransformer<out TModel> : ITransformer
where TModel : class
{
TModel Model { get; }
}
/// <summary>
/// An ISingleFeaturePredictionTransformer contains the name of the <see cref="FeatureColumnName"/>
/// and its type, <see cref="FeatureColumnType"/>. Implementations of this interface, have the ability
/// to score the data of an input <see cref="IDataView"/> through the <see cref="ITransformer.Transform(IDataView)"/>
/// </summary>
/// <typeparam name="TModel">The <see cref="IPredictor"/> or <see cref="ICalibrator"/> used for the data transformation.</typeparam>
public interface ISingleFeaturePredictionTransformer<out TModel> : IPredictionTransformer<TModel>
where TModel : class
{
/// <summary>The name of the feature column.</summary>
string FeatureColumnName { get; }
/// <summary>Holds information about the type of the feature column.</summary>
DataViewType FeatureColumnType { get; }
}
/// <summary>
/// An ISingleFeaturePredictionTransformer contains the name of the <see cref="FeatureColumnName"/>
/// and its type, <see cref="FeatureColumnType"/>. Implementations of this interface, have the ability
/// to score the data of an input <see cref="IDataView"/> through the <see cref="ITransformer.Transform(IDataView)"/>
/// </summary>
[BestFriend]
internal interface ISingleFeaturePredictionTransformer : ITransformer
{
/// <summary>The name of the feature column.</summary>
string FeatureColumnName { get; }
}
}