Search Results for

    Show / Hide Table of Contents

    Interface IPredictorMapping<TInstanceSource, TInstance, TLabelSource, TLabel, TFeatures>

    A mapping used by the implementations of IPredictor<TInstanceSource, TInstance, TLabelSource, TResult, TResultDist> interface to convert user data to an appropriate format.

    Namespace: Microsoft.ML.Probabilistic.Learners.Mappings
    Assembly: Microsoft.ML.Probabilistic.Learners.dll
    Syntax
    public interface IPredictorMapping<in TInstanceSource, TInstance, in TLabelSource, out TLabel, out 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 features.

    Methods

    GetFeatures(TInstance, TInstanceSource)

    Provides the features for a given instance.

    Declaration
    TFeatures GetFeatures(TInstance instance, TInstanceSource instanceSource = null)
    Parameters
    Type Name Description
    TInstance instance

    The instance to provide features for.

    TInstanceSource instanceSource

    An optional source of instances.

    Returns
    Type Description
    TFeatures

    The features for the given instance.

    Remarks

    Assumes that the same instance source always provides the same features for a given instance.

    GetInstances(TInstanceSource)

    Provides the instances for a given instance source.

    Declaration
    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
    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.

    Extension Methods

    PredictorMappingExtensions.GetInstancesSafe<TInstanceSource, TInstance, TLabelSource, TLabel, TFeatures>(IPredictorMapping<TInstanceSource, TInstance, TLabelSource, TLabel, TFeatures>, TInstanceSource)
    PredictorMappingExtensions.GetFeaturesSafe<TInstanceSource, TInstance, TLabelSource, TLabel, TFeatures>(IPredictorMapping<TInstanceSource, TInstance, TLabelSource, TLabel, TFeatures>, TInstance, TInstanceSource)
    PredictorMappingExtensions.GetLabelSafe<TInstanceSource, TInstance, TLabelSource, TLabel, TFeatures>(IPredictorMapping<TInstanceSource, TInstance, TLabelSource, TLabel, TFeatures>, TInstance, TInstanceSource, TLabelSource)
    In This Article
    Back to top Copyright © .NET Foundation. All rights reserved.