Packages

class FeatureBalanceMeasure extends Transformer with DataBalanceParams with HasLabelCol with ComplexParamsWritable with Wrappable with BasicLogging

This transformer computes a set of balance measures from the given dataframe and sensitive features.

The output is a dataframe that contains four columns:

  • The sensitive feature name.
  • A feature value within the sensitive feature.
  • Another feature value within the sensitive feature.
  • A struct containing measure names and their values showing parities between the two feature values. The following measures are computed:
    • Demographic Parity - https://en.wikipedia.org/wiki/Fairness_(machine_learning)
    • Pointwise Mutual Information - https://en.wikipedia.org/wiki/Pointwise_mutual_information
    • Sorensen-Dice Coefficient - https://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coefficient
    • Jaccard Index - https://en.wikipedia.org/wiki/Jaccard_index
    • Kendall Rank Correlation - https://en.wikipedia.org/wiki/Kendall_rank_correlation_coefficient
    • Log-Likelihood Ratio - https://en.wikipedia.org/wiki/Likelihood_function#Likelihood_ratio
    • t-test - https://en.wikipedia.org/wiki/Student's_t-test

The output dataframe contains a row per combination of feature values for each sensitive feature.

Annotations
@Experimental()
Linear Supertypes
BasicLogging, Wrappable, RWrappable, PythonWrappable, BaseWrappable, ComplexParamsWritable, MLWritable, HasLabelCol, DataBalanceParams, HasOutputCol, Transformer, PipelineStage, Logging, Params, Serializable, Serializable, Identifiable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FeatureBalanceMeasure
  2. BasicLogging
  3. Wrappable
  4. RWrappable
  5. PythonWrappable
  6. BaseWrappable
  7. ComplexParamsWritable
  8. MLWritable
  9. HasLabelCol
  10. DataBalanceParams
  11. HasOutputCol
  12. Transformer
  13. PipelineStage
  14. Logging
  15. Params
  16. Serializable
  17. Serializable
  18. Identifiable
  19. AnyRef
  20. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new FeatureBalanceMeasure()
  2. new FeatureBalanceMeasure(uid: String)

    uid

    The unique ID.

Value Members

  1. val classACol: Param[String]
  2. val classBCol: Param[String]
  3. final def clear(param: Param[_]): FeatureBalanceMeasure.this.type
    Definition Classes
    Params
  4. def copy(extra: ParamMap): Transformer
    Definition Classes
    FeatureBalanceMeasure → Transformer → PipelineStage → Params
  5. def explainParam(param: Param[_]): String
    Definition Classes
    Params
  6. def explainParams(): String
    Definition Classes
    Params
  7. final def extractParamMap(): ParamMap
    Definition Classes
    Params
  8. final def extractParamMap(extra: ParamMap): ParamMap
    Definition Classes
    Params
  9. val featureNameCol: Param[String]
  10. final def get[T](param: Param[T]): Option[T]
    Definition Classes
    Params
  11. def getClassACol: String
  12. def getClassBCol: String
  13. final def getDefault[T](param: Param[T]): Option[T]
    Definition Classes
    Params
  14. def getFeatureNameCol: String
  15. final def getLabelCol: String
    Definition Classes
    HasLabelCol
  16. final def getOrDefault[T](param: Param[T]): T
    Definition Classes
    Params
  17. final def getOutputCol: String
    Definition Classes
    HasOutputCol
  18. def getParam(paramName: String): Param[Any]
    Definition Classes
    Params
  19. def getSensitiveCols: Array[String]
    Definition Classes
    DataBalanceParams
  20. def getVerbose: Boolean
    Definition Classes
    DataBalanceParams
  21. final def hasDefault[T](param: Param[T]): Boolean
    Definition Classes
    Params
  22. def hasParam(paramName: String): Boolean
    Definition Classes
    Params
  23. final def isDefined(param: Param[_]): Boolean
    Definition Classes
    Params
  24. final def isSet(param: Param[_]): Boolean
    Definition Classes
    Params
  25. final val labelCol: Param[String]
    Definition Classes
    HasLabelCol
  26. def logClass(): Unit
    Definition Classes
    BasicLogging
  27. def logFit[T](f: ⇒ T): T
    Definition Classes
    BasicLogging
  28. def logPredict[T](f: ⇒ T): T
    Definition Classes
    BasicLogging
  29. def logTrain[T](f: ⇒ T): T
    Definition Classes
    BasicLogging
  30. def logTransform[T](f: ⇒ T): T
    Definition Classes
    BasicLogging
  31. def logVerb[T](verb: String, f: ⇒ T): T
    Definition Classes
    BasicLogging
  32. def makePyFile(conf: CodegenConfig): Unit
    Definition Classes
    PythonWrappable
  33. def makeRFile(conf: CodegenConfig): Unit
    Definition Classes
    RWrappable
  34. final val outputCol: Param[String]
    Definition Classes
    HasOutputCol
  35. lazy val params: Array[Param[_]]
    Definition Classes
    Params
  36. def pyAdditionalMethods: String
    Definition Classes
    PythonWrappable
  37. def pyInitFunc(): String
    Definition Classes
    PythonWrappable
  38. def save(path: String): Unit
    Definition Classes
    MLWritable
    Annotations
    @Since( "1.6.0" ) @throws( ... )
  39. val sensitiveCols: StringArrayParam
    Definition Classes
    DataBalanceParams
  40. final def set[T](param: Param[T], value: T): FeatureBalanceMeasure.this.type
    Definition Classes
    Params
  41. def setClassACol(value: String): FeatureBalanceMeasure.this.type
  42. def setClassBCol(value: String): FeatureBalanceMeasure.this.type
  43. def setFeatureNameCol(value: String): FeatureBalanceMeasure.this.type
  44. def setLabelCol(value: String): FeatureBalanceMeasure.this.type
  45. def setOutputCol(value: String): FeatureBalanceMeasure.this.type
    Definition Classes
    DataBalanceParams
  46. def setSensitiveCols(values: Array[String]): FeatureBalanceMeasure.this.type
    Definition Classes
    DataBalanceParams
  47. def setVerbose(value: Boolean): FeatureBalanceMeasure.this.type
    Definition Classes
    DataBalanceParams
  48. def toString(): String
    Definition Classes
    Identifiable → AnyRef → Any
  49. def transform(dataset: Dataset[_]): DataFrame
    Definition Classes
    FeatureBalanceMeasure → Transformer
  50. def transform(dataset: Dataset[_], paramMap: ParamMap): DataFrame
    Definition Classes
    Transformer
    Annotations
    @Since( "2.0.0" )
  51. def transform(dataset: Dataset[_], firstParamPair: ParamPair[_], otherParamPairs: ParamPair[_]*): DataFrame
    Definition Classes
    Transformer
    Annotations
    @Since( "2.0.0" ) @varargs()
  52. def transformSchema(schema: StructType): StructType
    Definition Classes
    FeatureBalanceMeasure → PipelineStage
  53. val uid: String
    Definition Classes
    FeatureBalanceMeasureBasicLogging → Identifiable
  54. def validateSchema(schema: StructType): Unit
  55. val ver: String
    Definition Classes
    BasicLogging
  56. val verbose: BooleanParam
    Definition Classes
    DataBalanceParams
  57. def write: MLWriter
    Definition Classes
    ComplexParamsWritable → MLWritable