hex.rf
Class MinorityClasses

java.lang.Object
  extended by 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.


Nested Class Summary
static class MinorityClasses.ClassExtractTask
           
static class MinorityClasses.CountMClassRowsTask
           
static class MinorityClasses.HistogramTask
           
static class MinorityClasses.ReplicationTask
           
static class MinorityClasses.UnbalancedClass
           
 
Constructor Summary
MinorityClasses()
           
 
Method Summary
static long countMajorityClassRows(Key aryKey, Key[] keys, int[] minorities, int classIdx)
           
static MinorityClasses.UnbalancedClass[] extractUnbalancedClasses(ValueArray data, int classIdx, int[] classIds)
           
static int[] globalHistogram(int[][] histogram)
           
static int[][] histogram(ValueArray data, int classIdx)
           
static int[][] histogram(ValueArray data, Key[] keys, int classIdx)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MinorityClasses

public MinorityClasses()
Method Detail

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)