Class PairDistribution<T1,T2>

java.lang.Object
org.tribuo.util.infotheory.impl.PairDistribution<T1,T2>
Type Parameters:
T1 - The type of the first element
T2 - The type of the second element

public class PairDistribution<T1,T2> extends Object
A count distribution over CachedPair objects.
  • Field Details

    • count

      public final long count
    • jointCounts

      public final Map<CachedPair<T1,T2>, com.oracle.labs.mlrg.olcut.util.MutableLong> jointCounts
    • firstCount

      public final Map<T1, com.oracle.labs.mlrg.olcut.util.MutableLong> firstCount
    • secondCount

      public final Map<T2, com.oracle.labs.mlrg.olcut.util.MutableLong> secondCount
  • Constructor Details

  • Method Details

    • constructFromLists

      public static <T1,T2> PairDistribution<T1,T2> constructFromLists(List<T1> first, List<T2> second)
      Generates the counts for two vectors. Returns a PairDistribution containing the joint count, and the two marginal counts.
      Type Parameters:
      T1 - Type of the first array.
      T2 - Type of the second array.
      Parameters:
      first - An array of values.
      second - Another array of values.
      Returns:
      The joint counts and the two marginal counts.
    • constructFromMap

      public static <T1,T2> PairDistribution<T1,T2> constructFromMap(Map<CachedPair<T1,T2>, com.oracle.labs.mlrg.olcut.util.MutableLong> jointCount)
    • constructFromMap

      public static <T1,T2> PairDistribution<T1,T2> constructFromMap(Map<CachedPair<T1,T2>, com.oracle.labs.mlrg.olcut.util.MutableLong> jointCount, int aSize, int bSize)
    • constructFromMap

      public static <T1,T2> PairDistribution<T1,T2> constructFromMap(Map<CachedPair<T1,T2>, com.oracle.labs.mlrg.olcut.util.MutableLong> jointCount, Map<T1, com.oracle.labs.mlrg.olcut.util.MutableLong> aCount, Map<T2, com.oracle.labs.mlrg.olcut.util.MutableLong> bCount)