hex.rf
Class MinorityClasses
java.lang.Object
hex.rf.MinorityClasses
public class MinorityClasses
- extends java.lang.Object
Contains methods for extracting minority classes out of value array and redistributing them to all nodes.
Class is considered to be minor if it's frequency relative to the majority class is below given threshold.
Setting the threshold to 1.0 will cause all classes with fewer occurences than the majority class to be redistributed everywhere.
Setting it to 0 will cause none of the classes to be redistributed.
Major class(es) is(are) always left untouched.
Classes are extracted into new Values and their keys are accumulated. Redistribution step takes those keys as the input
and redistributes them across all nodes.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MinorityClasses
public MinorityClasses()
histogram
public static int[][] histogram(ValueArray data,
int classIdx)
histogram
public static int[][] histogram(ValueArray data,
Key[] keys,
int classIdx)
countMajorityClassRows
public static long countMajorityClassRows(Key aryKey,
Key[] keys,
int[] minorities,
int classIdx)
extractUnbalancedClasses
public static MinorityClasses.UnbalancedClass[] extractUnbalancedClasses(ValueArray data,
int classIdx,
int[] classIds)
globalHistogram
public static int[] globalHistogram(int[][] histogram)