Interface IClassifierMapping<TInstanceSource, TInstance, TLabelSource, TLabel, TFeatures>
A mapping used by classifier implementations of the IPredictor<TInstanceSource, TInstance, TLabelSource, TResult, TResultDist> interface to convert user data to an appropriate format.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Learners.Mappings
Assembly: Microsoft.ML.Probabilistic.Learners.Classifier.dll
Syntax
public interface IClassifierMapping<in TInstanceSource, TInstance, in TLabelSource, TLabel, out TFeatures> : IPredictorMapping<TInstanceSource, TInstance, TLabelSource, TLabel, TFeatures>
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 labels. |
TLabel | The type of a label. |
TFeatures | The type of the feature values. |
Methods
GetClassLabels(TInstanceSource, TLabelSource)
Gets all class labels.
Declaration
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. |
LabelToString(TLabel)
Serializes a label to a string.
Declaration
string LabelToString(TLabel label)
Parameters
Type | Name | Description |
---|---|---|
TLabel | label |
Returns
Type | Description |
---|---|
String |
ParseLabel(String)
Deserializes a label from a string. Reverses LabelToString(TLabel).
Declaration
TLabel ParseLabel(string labelString)
Parameters
Type | Name | Description |
---|---|---|
String | labelString | The output of LabelToString(TLabel) |
Returns
Type | Description |
---|---|
TLabel | The label |