Class Massaging


  • public class Massaging
    extends java.lang.Object
    Class for building and using a Classyfing without Discriminating classifier. Numeric attributes are modelled by a normal distribution. For more Discrimination has been calculated by taking the difference of confidence of SA values for decired class(DC) Discrimination is removed by using the reweighing technique of CND Author Toon Calders, Faisal Kamran
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static int cdCount
      cpCount=number of candidates for promotion cdCount=numeber of candidates for demotion
      static Classifier classifier
      Classifier used as Ranker
      protected static double confDep
      Confidence of deprived community for desired class(dc)
      protected static double confFav
      Confidence of favoured community for desired class(dc)
      protected static int cpCount
      cpCount=number of candidates for promotion cdCount=numeber of candidates for demotion
      protected int dcIndex
      To store a desired class(dc) index and Not desired class index(ndc) from weka.classifiers.discrimination.java
      static double epsilon  
      protected static double favNeg
      All the counts for sensitive attribute value for positve and negative classes.
      protected Instances massagedInst
      The data set after tapplying massaging
      protected int ndcIndex
      To store a desired class(dc) index and Not desired class index(ndc) from weka.classifiers.discrimination.java
      protected static double savPos
      All the counts for sensitive attribute value for positve and negative classes.
      protected double[][] sortedDemotionList
      array for sorted demotion list
      protected double[][] sortedPromotionList
      array for sorted promotion list
      static int totalChanges
      To count the total number of changes in the train set by massaging
    • Constructor Summary

      Constructors 
      Constructor Description
      Massaging()  
    • Field Detail

      • totalChanges

        public static int totalChanges
        To count the total number of changes in the train set by massaging
      • epsilon

        public static double epsilon
      • massagedInst

        protected Instances massagedInst
        The data set after tapplying massaging
      • savPos

        protected static double savPos
        All the counts for sensitive attribute value for positve and negative classes. saPos=favoured community with positve class savPos=sav&+
      • favNeg

        protected static double favNeg
        All the counts for sensitive attribute value for positve and negative classes. saPos=favoured community with positve class savPos=sav&+
      • sortedPromotionList

        protected double[][] sortedPromotionList
        array for sorted promotion list
      • sortedDemotionList

        protected double[][] sortedDemotionList
        array for sorted demotion list
      • confDep

        protected static double confDep
        Confidence of deprived community for desired class(dc)
      • confFav

        protected static double confFav
        Confidence of favoured community for desired class(dc)
      • cpCount

        protected static int cpCount
        cpCount=number of candidates for promotion cdCount=numeber of candidates for demotion
      • cdCount

        protected static int cdCount
        cpCount=number of candidates for promotion cdCount=numeber of candidates for demotion
      • dcIndex

        protected int dcIndex
        To store a desired class(dc) index and Not desired class index(ndc) from weka.classifiers.discrimination.java
      • ndcIndex

        protected int ndcIndex
        To store a desired class(dc) index and Not desired class index(ndc) from weka.classifiers.discrimination.java
      • classifier

        public static Classifier classifier
        Classifier used as Ranker
    • Constructor Detail

      • Massaging

        public Massaging()
    • Method Detail

      • setRanker

        public static void setRanker​(Classifier classifierName)
      • cndApplication

        public Instances cndApplication​(Instances instances,
                                        double promote,
                                        double demote)
                                 throws java.lang.Exception
        Parameters:
        instances - dataset for massa
        Returns:
        Throws:
        java.lang.Exception
      • cndApplication

        public Instances cndApplication​(Instances instances)
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • ranker

        public void ranker​(Instances instances)
                    throws java.lang.Exception
        ranker method produces sorted promotion and demotion list for CND
        Parameters:
        instances -
        Throws:
        java.lang.Exception
      • confidenceDiff

        public static double confidenceDiff()
        Returns:
        confidence difference of "sav" and "fav" for "dc"
      • sorting

        public static double[][] sorting​(double[][] arrayToSort,
                                         int length,
                                         int type)
        method to sort the 2-D arrays
        Parameters:
        arrayToSort - A 2-D array which we want to sort
        type - 1 is descending order and type 2 is for ascending order
        Returns:
        sorted array