Search Results for

    Show / Hide Table of Contents

    Interface IBayesPointMachineClassifierMapping<TInstanceSource, TInstance, TLabelSource, TLabel>

    A mapping to access data in the native format of implementations of the IBayesPointMachineClassifier<TInstanceSource, TInstance, TLabelSource, TLabel, TLabelDistribution, TTrainingSettings, TPredictionSettings> interface.

    Namespace: Microsoft.ML.Probabilistic.Learners.Mappings
    Assembly: Microsoft.ML.Probabilistic.Learners.Classifier.dll
    Syntax
    public interface IBayesPointMachineClassifierMapping<in TInstanceSource, in TInstance, in TLabelSource, out TLabel>
    Type Parameters
    Name Description
    TInstanceSource

    The type of the instance source.

    TInstance

    The type of an instance.

    TLabelSource

    The type of the label source.

    TLabel

    The type of a label.

    Remarks

    This interface allows to provide features in one of two representations: dense and sparse. To provide features in a dense representation, all arrays over feature indexes must be null and all instances must have the same number of feature values. To provide features in a sparse representation, each single instance must have the same number of feature indexes and values (arrays over feature indexes must not be null).

    Methods

    GetClassCount(TInstanceSource, TLabelSource)

    Provides the number of classes that the Bayes point machine classifier is used for.

    Declaration
    int GetClassCount(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
    Int32

    The number of classes that the Bayes point machine classifier is used for.

    GetFeatureCount(TInstanceSource)

    Provides the total number of features for the specified instance source.

    Declaration
    int GetFeatureCount(TInstanceSource instanceSource)
    Parameters
    Type Name Description
    TInstanceSource instanceSource

    The instance source.

    Returns
    Type Description
    Int32

    The total number of features.

    GetFeatureIndexes(TInstanceSource, Int32)

    Provides the feature indexes of all instances from the specified batch of the instance source.

    Declaration
    int[][] GetFeatureIndexes(TInstanceSource instanceSource, int batchNumber = 0)
    Parameters
    Type Name Description
    TInstanceSource instanceSource

    The instance source.

    Int32 batchNumber

    An optional batch number. Defaults to 0 and is used only if the instance source is divided into batches.

    Returns
    Type Description
    Int32[][]

    The feature indexes provided by the specified batch of the instance source. Null if feature values are in a dense representation.

    GetFeatureIndexes(TInstance, TInstanceSource)

    Provides the feature indexes for a specified instance.

    Declaration
    int[] GetFeatureIndexes(TInstance instance, TInstanceSource instanceSource = null)
    Parameters
    Type Name Description
    TInstance instance

    The instance.

    TInstanceSource instanceSource

    An optional instance source.

    Returns
    Type Description
    Int32[]

    The feature indexes for the specified instance. Null if feature values are in a dense representation.

    GetFeatureValues(TInstanceSource, Int32)

    Provides the feature values of all instances from the specified batch of the instance source.

    Declaration
    double[][] GetFeatureValues(TInstanceSource instanceSource, int batchNumber = 0)
    Parameters
    Type Name Description
    TInstanceSource instanceSource

    The instance source.

    Int32 batchNumber

    An optional batch number. Defaults to 0 and is used only if the instance source is divided into batches.

    Returns
    Type Description
    Double[][]

    The feature values provided by the specified batch of the instance source.

    GetFeatureValues(TInstance, TInstanceSource)

    Provides the feature values for a specified instance.

    Declaration
    double[] GetFeatureValues(TInstance instance, TInstanceSource instanceSource = null)
    Parameters
    Type Name Description
    TInstance instance

    The instance.

    TInstanceSource instanceSource

    An optional instance source.

    Returns
    Type Description
    Double[]

    The feature values for the specified instance.

    GetLabels(TInstanceSource, TLabelSource, Int32)

    Provides the labels of all instances from the specified batch of the instance source.

    Declaration
    TLabel[] GetLabels(TInstanceSource instanceSource, TLabelSource labelSource = null, int batchNumber = 0)
    Parameters
    Type Name Description
    TInstanceSource instanceSource

    The instance source.

    TLabelSource labelSource

    An optional label source.

    Int32 batchNumber

    An optional batch number. Defaults to 0 and is used only if the instance and label sources are divided into batches.

    Returns
    Type Description
    TLabel[]

    The labels provided by the specified batch of the sources.

    IsSparse(TInstanceSource)

    Indicates whether the feature representation provided by the instance source is sparse or dense.

    Declaration
    bool IsSparse(TInstanceSource instanceSource)
    Parameters
    Type Name Description
    TInstanceSource instanceSource

    The instance source.

    Returns
    Type Description
    Boolean

    True, if the feature representation is sparse and false if it is dense.

    Extension Methods

    BayesPointMachineClassifierMappingExtensions.GetFeatureCountSafe<TInstanceSource, TInstance, TLabelSource, TLabel>(IBayesPointMachineClassifierMapping<TInstanceSource, TInstance, TLabelSource, TLabel>, TInstanceSource)
    BayesPointMachineClassifierMappingExtensions.GetClassCountSafe<TInstanceSource, TInstance, TLabelSource, TLabel>(IBayesPointMachineClassifierMapping<TInstanceSource, TInstance, TLabelSource, TLabel>, TInstanceSource, TLabelSource)
    BayesPointMachineClassifierMappingExtensions.GetSingleFeatureVectorValuesSafe<TInstanceSource, TInstance, TLabelSource, TLabel>(IBayesPointMachineClassifierMapping<TInstanceSource, TInstance, TLabelSource, TLabel>, TInstance, TInstanceSource)
    BayesPointMachineClassifierMappingExtensions.GetSingleFeatureVectorIndexesSafe<TInstanceSource, TInstance, TLabelSource, TLabel>(IBayesPointMachineClassifierMapping<TInstanceSource, TInstance, TLabelSource, TLabel>, TInstance, TInstanceSource)
    BayesPointMachineClassifierMappingExtensions.GetAllFeatureVectorValuesSafe<TInstanceSource, TInstance, TLabelSource, TLabel>(IBayesPointMachineClassifierMapping<TInstanceSource, TInstance, TLabelSource, TLabel>, TInstanceSource, Int32)
    BayesPointMachineClassifierMappingExtensions.GetAllFeatureVectorIndexesSafe<TInstanceSource, TInstance, TLabelSource, TLabel>(IBayesPointMachineClassifierMapping<TInstanceSource, TInstance, TLabelSource, TLabel>, TInstanceSource, Int32)
    BayesPointMachineClassifierMappingExtensions.GetAllLabelsSafe<TInstanceSource, TInstance, TLabelSource, TLabel>(IBayesPointMachineClassifierMapping<TInstanceSource, TInstance, TLabelSource, TLabel>, TInstanceSource, TLabelSource, Int32)
    In This Article
    Back to top Copyright © .NET Foundation. All rights reserved.