Interface HasAffinity

  • All Superinterfaces:
    CategoricalResultFeature<java.lang.String>, ResultFeature
    All Known Subinterfaces:
    HasAffinityRanking
    All Known Implementing Classes:
    AffinityDistribution, ClusterAffinityDistribution

    public interface HasAffinity
    extends CategoricalResultFeature<java.lang.String>

    A marker interface for classification or clustering results that provide an affinity distribution.

    Affinity represents a degree of attraction between the sample and a particular category.

    PMML deals with two kinds of affinities:
    • Distance between two points in an n-dimensional feature space. Smaller distance values indicate more optimal fit.
    • Similarity between two feature vectors. Greater similarity values indicate more optimal fit.
    See Also:
    ResultFeature.AFFINITY
    • Method Detail

      • getAffinity

        java.lang.Double getAffinity​(java.lang.String category)

        Gets the affinity towards the specified category.

        Returns:
        An affinity in the range from 0.0 to positive infinity. The affinity of an unknown category is the least optimal value in the range of valid values (ie. Double.POSITIVE_INFINITY for distance measures and 0.0 for similarity measures).
        See Also:
        CategoricalResultFeature.getCategories()