Class ClassifierEvaluatorMapping<TInstanceSource, TInstance, TLabelSource, TLabel, TFeatureValues>
A mapping used by an evaluator of classifiers.
Inheritance
Implements
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Learners.Mappings
Assembly: Microsoft.ML.Probabilistic.Learners.Classifier.dll
Syntax
public class ClassifierEvaluatorMapping<TInstanceSource, TInstance, TLabelSource, TLabel, TFeatureValues> : IClassifierEvaluatorMapping<TInstanceSource, TInstance, TLabelSource, TLabel>
Type Parameters
Name | Description |
---|---|
TInstanceSource | The type of a source of instances. |
TInstance | The type of an instance. |
TLabelSource | The type of a source of ground truth labels. |
TLabel | The type of a label. |
TFeatureValues | The type of the feature values. |
Constructors
ClassifierEvaluatorMapping(IClassifierMapping<TInstanceSource, TInstance, TLabelSource, TLabel, TFeatureValues>)
Initializes a new instance of the ClassifierEvaluatorMapping<TInstanceSource, TInstance, TLabelSource, TLabel, TFeatureValues> class.
Declaration
public ClassifierEvaluatorMapping(IClassifierMapping<TInstanceSource, TInstance, TLabelSource, TLabel, TFeatureValues> mapping)
Parameters
Type | Name | Description |
---|---|---|
IClassifierMapping<TInstanceSource, TInstance, TLabelSource, TLabel, TFeatureValues> | mapping | A classifier mapping. |
Methods
GetClassLabels(TInstanceSource, TLabelSource)
Gets all class labels.
Declaration
public IEnumerable<TLabel> GetClassLabels(TInstanceSource instanceSource = null, TLabelSource labelSource = null)
Parameters
Type | Name | Description |
---|---|---|
TInstanceSource | instanceSource | An optional instance source. |
TLabelSource | labelSource | An optional label source. |
Returns
Type | Description |
---|---|
IEnumerable<TLabel> | All possible values of a label. |
GetInstances(TInstanceSource)
Provides the instances for a given instance source.
Declaration
public IEnumerable<TInstance> GetInstances(TInstanceSource instanceSource)
Parameters
Type | Name | Description |
---|---|---|
TInstanceSource | instanceSource | The source of instances. |
Returns
Type | Description |
---|---|
IEnumerable<TInstance> | The instances provided by the instance source. |
Remarks
Assumes that the same instance source always provides the same instances.
GetLabel(TInstance, TInstanceSource, TLabelSource)
Provides the label for a given instance.
Declaration
public TLabel GetLabel(TInstance instance, TInstanceSource instanceSource = null, TLabelSource labelSource = null)
Parameters
Type | Name | Description |
---|---|---|
TInstance | instance | The instance to provide the label for. |
TInstanceSource | instanceSource | An optional source of instances. |
TLabelSource | labelSource | An optional source of labels. |
Returns
Type | Description |
---|---|
TLabel | The label of the given instance. |
Remarks
Assumes that the same sources always provide the same label for a given instance.