Class PairDistribution<T1,T2>
java.lang.Object
org.tribuo.util.infotheory.impl.PairDistribution<T1,T2>
- Type Parameters:
T1
- The type of the first elementT2
- The type of the second element
A count distribution over
CachedPair
objects.-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal long
final Map
<CachedPair<T1, T2>, com.oracle.labs.mlrg.olcut.util.MutableLong> -
Constructor Summary
ConstructorsConstructorDescriptionPairDistribution
(long count, LinkedHashMap<CachedPair<T1, T2>, com.oracle.labs.mlrg.olcut.util.MutableLong> jointCounts, LinkedHashMap<T1, com.oracle.labs.mlrg.olcut.util.MutableLong> firstCount, LinkedHashMap<T2, com.oracle.labs.mlrg.olcut.util.MutableLong> secondCount) PairDistribution
(long count, Map<CachedPair<T1, T2>, com.oracle.labs.mlrg.olcut.util.MutableLong> jointCounts, Map<T1, com.oracle.labs.mlrg.olcut.util.MutableLong> firstCount, Map<T2, com.oracle.labs.mlrg.olcut.util.MutableLong> secondCount) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T1,
T2> PairDistribution <T1, T2> constructFromLists
(List<T1> first, List<T2> second) Generates the counts for two vectors.static <T1,
T2> PairDistribution <T1, T2> constructFromMap
(Map<CachedPair<T1, T2>, com.oracle.labs.mlrg.olcut.util.MutableLong> jointCount) static <T1,
T2> PairDistribution <T1, T2> constructFromMap
(Map<CachedPair<T1, T2>, com.oracle.labs.mlrg.olcut.util.MutableLong> jointCount, int aSize, int bSize) 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)
-
Field Details
-
count
-
jointCounts
-
firstCount
-
secondCount
-
-
Constructor Details
-
PairDistribution
public PairDistribution(long count, Map<CachedPair<T1, T2>, com.oracle.labs.mlrg.olcut.util.MutableLong> jointCounts, Map<T1, com.oracle.labs.mlrg.olcut.util.MutableLong> firstCount, Map<T2, com.oracle.labs.mlrg.olcut.util.MutableLong> secondCount) -
PairDistribution
public PairDistribution(long count, LinkedHashMap<CachedPair<T1, T2>, com.oracle.labs.mlrg.olcut.util.MutableLong> jointCounts, LinkedHashMap<T1, com.oracle.labs.mlrg.olcut.util.MutableLong> firstCount, LinkedHashMap<T2, com.oracle.labs.mlrg.olcut.util.MutableLong> secondCount)
-
-
Method Details
-
constructFromLists
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)
-