Package com.tibco.patterns.learn.api.hint

## Class HintAddLabel

- java.lang.Object
- - com.tibco.patterns.learn.api.hint.HintAddPairs
  - - com.tibco.patterns.learn.api.hint.HintAddLabel

- All Implemented Interfaces:
    `Hint`

      public final class HintAddLabel
      extends HintAddPairs

  Hint to add pairs for subsets that have too few True/False labels.

- - ### Field Summary

    - ### Fields inherited from class com.tibco.patterns.learn.api.hint.HintAddPairs

      `subsets`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static HintAddLabel` | `create​(FeatureQuery fq, DatasetStats trainStats, RecPair.Label label, double minProportion)` | Creates a hint object with all subsets where the proportion of pairs with the given label is lower than minProportion.
    `RecPair.Label` | `getLabel()` |

    - ### Methods inherited from class com.tibco.patterns.learn.api.hint.HintAddPairs

      `getCount, getSubsets, size, suitableRecord, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### getLabel

          public RecPair.Label getLabel()

      Returns:
        the label used to generate this hint.

    - #### create

          public static HintAddLabel create​(FeatureQuery fq,
                                            DatasetStats trainStats,
                                            RecPair.Label label,
                                            double minProportion)

      Creates a hint object with all subsets where the proportion of pairs with the given label is lower than minProportion.
      Parameters:
        `trainStats` - - statistics for training dataset (for all pairs with bool labels).
        `label` - - the label to create the hint for.
        `minProportion` - - minimum proportion of the label required for balanced subset. Subsets that have fewer pairs with this label are added to the hint.
      Returns:
        the new hint object. Returns null if no such subsets can be found (all subsets in training dataset have balanced labels).
      Throws:
        `java.lang.IllegalArgumentException` - if minProportion is not in [0; 0.5] range.