/
OutputCombiner.cs
49 lines (41 loc) · 2.33 KB
/
OutputCombiner.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.EntryPoints;
using Microsoft.ML.Trainers.Ensemble;
[assembly: EntryPointModule(typeof(AverageFactory))]
[assembly: EntryPointModule(typeof(MedianFactory))]
[assembly: EntryPointModule(typeof(MultiAverage))]
[assembly: EntryPointModule(typeof(MultiMedian))]
[assembly: EntryPointModule(typeof(MultiStacking))]
[assembly: EntryPointModule(typeof(MultiVotingFactory))]
[assembly: EntryPointModule(typeof(MultiWeightedAverage))]
[assembly: EntryPointModule(typeof(RegressionStacking))]
[assembly: EntryPointModule(typeof(Stacking))]
[assembly: EntryPointModule(typeof(VotingFactory))]
[assembly: EntryPointModule(typeof(WeightedAverage))]
namespace Microsoft.ML.Trainers.Ensemble
{
[TlcModule.Component(Name = Average.LoadName, FriendlyName = Average.UserName)]
public sealed class AverageFactory : ISupportBinaryOutputCombinerFactory, ISupportRegressionOutputCombinerFactory
{
public IRegressionOutputCombiner CreateComponent(IHostEnvironment env) => new Average(env);
IBinaryOutputCombiner IComponentFactory<IBinaryOutputCombiner>.CreateComponent(IHostEnvironment env) => new Average(env);
}
[TlcModule.Component(Name = Median.LoadName, FriendlyName = Median.UserName)]
public sealed class MedianFactory : ISupportBinaryOutputCombinerFactory, ISupportRegressionOutputCombinerFactory
{
public IRegressionOutputCombiner CreateComponent(IHostEnvironment env) => new Median(env);
IBinaryOutputCombiner IComponentFactory<IBinaryOutputCombiner>.CreateComponent(IHostEnvironment env) => new Median(env);
}
[TlcModule.Component(Name = Voting.LoadName, FriendlyName = Voting.UserName)]
public sealed class VotingFactory : ISupportBinaryOutputCombinerFactory
{
IBinaryOutputCombiner IComponentFactory<IBinaryOutputCombiner>.CreateComponent(IHostEnvironment env) => new Voting(env);
}
[TlcModule.Component(Name = MultiVoting.LoadName, FriendlyName = Voting.UserName)]
public sealed class MultiVotingFactory : ISupportMulticlassOutputCombinerFactory
{
public IMultiClassOutputCombiner CreateComponent(IHostEnvironment env) => new MultiVoting(env);
}
}