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. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def $[T](param: Param[T]): T
    Attributes
    protected
    Definition Classes
    Params
  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. val classACol: Param[String]
  7. val classBCol: Param[String]
  8. lazy val classNameHelper: String
    Attributes
    protected
    Definition Classes
    BaseWrappable
  9. final def clear(param: Param[_]): FeatureBalanceMeasure.this.type
    Definition Classes
    Params
  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  11. def companionModelClassName: String
    Attributes
    protected
    Definition Classes
    BaseWrappable
  12. def copy(extra: ParamMap): Transformer
    Definition Classes
    FeatureBalanceMeasure → Transformer → PipelineStage → Params
  13. def copyValues[T <: Params](to: T, extra: ParamMap): T
    Attributes
    protected
    Definition Classes
    Params
  14. lazy val copyrightLines: String
    Attributes
    protected
    Definition Classes
    BaseWrappable
  15. final def defaultCopy[T <: Params](extra: ParamMap): T
    Attributes
    protected
    Definition Classes
    Params
  16. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  18. def explainParam(param: Param[_]): String
    Definition Classes
    Params
  19. def explainParams(): String
    Definition Classes
    Params
  20. final def extractParamMap(): ParamMap
    Definition Classes
    Params
  21. final def extractParamMap(extra: ParamMap): ParamMap
    Definition Classes
    Params
  22. val featureNameCol: Param[String]
  23. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. final def get[T](param: Param[T]): Option[T]
    Definition Classes
    Params
  25. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  26. def getClassACol: String
  27. def getClassBCol: String
  28. final def getDefault[T](param: Param[T]): Option[T]
    Definition Classes
    Params
  29. def getFeatureNameCol: String
  30. final def getLabelCol: String
    Definition Classes
    HasLabelCol
  31. final def getOrDefault[T](param: Param[T]): T
    Definition Classes
    Params
  32. final def getOutputCol: String
    Definition Classes
    HasOutputCol
  33. def getParam(paramName: String): Param[Any]
    Definition Classes
    Params
  34. def getSensitiveCols: Array[String]
    Definition Classes
    DataBalanceParams
  35. def getVerbose: Boolean
    Definition Classes
    DataBalanceParams
  36. final def hasDefault[T](param: Param[T]): Boolean
    Definition Classes
    Params
  37. def hasParam(paramName: String): Boolean
    Definition Classes
    Params
  38. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  39. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  40. def initializeLogIfNecessary(isInterpreter: Boolean): Unit
    Attributes
    protected
    Definition Classes
    Logging
  41. final def isDefined(param: Param[_]): Boolean
    Definition Classes
    Params
  42. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  43. final def isSet(param: Param[_]): Boolean
    Definition Classes
    Params
  44. def isTraceEnabled(): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  45. final val labelCol: Param[String]
    Definition Classes
    HasLabelCol
  46. def log: Logger
    Attributes
    protected
    Definition Classes
    Logging
  47. def logBase(methodName: String): Unit
    Attributes
    protected
    Definition Classes
    BasicLogging
  48. def logClass(): Unit
    Definition Classes
    BasicLogging
  49. def logDebug(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  50. def logDebug(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  51. def logError(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  52. def logError(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  53. def logErrorBase(methodName: String, e: Exception): Unit
    Attributes
    protected
    Definition Classes
    BasicLogging
  54. def logFit[T](f: ⇒ T): T
    Definition Classes
    BasicLogging
  55. def logInfo(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  56. def logInfo(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  57. def logName: String
    Attributes
    protected
    Definition Classes
    Logging
  58. def logPredict[T](f: ⇒ T): T
    Definition Classes
    BasicLogging
  59. def logTrace(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  60. def logTrace(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  61. def logTrain[T](f: ⇒ T): T
    Definition Classes
    BasicLogging
  62. def logTransform[T](f: ⇒ T): T
    Definition Classes
    BasicLogging
  63. def logVerb[T](verb: String, f: ⇒ T): T
    Definition Classes
    BasicLogging
  64. def logWarning(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  65. def logWarning(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  66. def makePyFile(conf: CodegenConfig): Unit
    Definition Classes
    PythonWrappable
  67. def makeRFile(conf: CodegenConfig): Unit
    Definition Classes
    RWrappable
  68. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  69. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  70. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  71. final val outputCol: Param[String]
    Definition Classes
    HasOutputCol
  72. lazy val params: Array[Param[_]]
    Definition Classes
    Params
  73. def pyAdditionalMethods: String
    Definition Classes
    PythonWrappable
  74. lazy val pyClassDoc: String
    Attributes
    protected
    Definition Classes
    PythonWrappable
  75. lazy val pyClassName: String
    Attributes
    protected
    Definition Classes
    PythonWrappable
  76. def pyExtraEstimatorImports: String
    Attributes
    protected
    Definition Classes
    PythonWrappable
  77. def pyExtraEstimatorMethods: String
    Attributes
    protected
    Definition Classes
    PythonWrappable
  78. lazy val pyInheritedClasses: Seq[String]
    Attributes
    protected
    Definition Classes
    PythonWrappable
  79. def pyInitFunc(): String
    Definition Classes
    PythonWrappable
  80. lazy val pyInternalWrapper: Boolean
    Attributes
    protected
    Definition Classes
    PythonWrappable
  81. lazy val pyObjectBaseClass: String
    Attributes
    protected
    Definition Classes
    PythonWrappable
  82. def pyParamArg[T](p: Param[T]): String
    Attributes
    protected
    Definition Classes
    PythonWrappable
  83. def pyParamDefault[T](p: Param[T]): Option[String]
    Attributes
    protected
    Definition Classes
    PythonWrappable
  84. def pyParamGetter(p: Param[_]): String
    Attributes
    protected
    Definition Classes
    PythonWrappable
  85. def pyParamSetter(p: Param[_]): String
    Attributes
    protected
    Definition Classes
    PythonWrappable
  86. def pyParamsArgs: String
    Attributes
    protected
    Definition Classes
    PythonWrappable
  87. def pyParamsDefaults: String
    Attributes
    protected
    Definition Classes
    PythonWrappable
  88. lazy val pyParamsDefinitions: String
    Attributes
    protected
    Definition Classes
    PythonWrappable
  89. def pyParamsGetters: String
    Attributes
    protected
    Definition Classes
    PythonWrappable
  90. def pyParamsSetters: String
    Attributes
    protected
    Definition Classes
    PythonWrappable
  91. def pythonClass(): String
    Attributes
    protected
    Definition Classes
    PythonWrappable
  92. def rClass(): String
    Attributes
    protected
    Definition Classes
    RWrappable
  93. def rDocString: String
    Attributes
    protected
    Definition Classes
    RWrappable
  94. def rExtraBodyLines: String
    Attributes
    protected
    Definition Classes
    RWrappable
  95. def rExtraInitLines: String
    Attributes
    protected
    Definition Classes
    RWrappable
  96. lazy val rFuncName: String
    Attributes
    protected
    Definition Classes
    RWrappable
  97. lazy val rInternalWrapper: Boolean
    Attributes
    protected
    Definition Classes
    RWrappable
  98. def rParamArg[T](p: Param[T]): String
    Attributes
    protected
    Definition Classes
    RWrappable
  99. def rParamsArgs: String
    Attributes
    protected
    Definition Classes
    RWrappable
  100. def rSetterLines: String
    Attributes
    protected
    Definition Classes
    RWrappable
  101. def save(path: String): Unit
    Definition Classes
    MLWritable
    Annotations
    @Since( "1.6.0" ) @throws( ... )
  102. val sensitiveCols: StringArrayParam
    Definition Classes
    DataBalanceParams
  103. final def set(paramPair: ParamPair[_]): FeatureBalanceMeasure.this.type
    Attributes
    protected
    Definition Classes
    Params
  104. final def set(param: String, value: Any): FeatureBalanceMeasure.this.type
    Attributes
    protected
    Definition Classes
    Params
  105. final def set[T](param: Param[T], value: T): FeatureBalanceMeasure.this.type
    Definition Classes
    Params
  106. def setClassACol(value: String): FeatureBalanceMeasure.this.type
  107. def setClassBCol(value: String): FeatureBalanceMeasure.this.type
  108. final def setDefault(paramPairs: ParamPair[_]*): FeatureBalanceMeasure.this.type
    Attributes
    protected
    Definition Classes
    Params
  109. final def setDefault[T](param: Param[T], value: T): FeatureBalanceMeasure.this.type
    Attributes
    protected
    Definition Classes
    Params
  110. def setFeatureNameCol(value: String): FeatureBalanceMeasure.this.type
  111. def setLabelCol(value: String): FeatureBalanceMeasure.this.type
  112. def setOutputCol(value: String): FeatureBalanceMeasure.this.type
    Definition Classes
    DataBalanceParams
  113. def setSensitiveCols(values: Array[String]): FeatureBalanceMeasure.this.type
    Definition Classes
    DataBalanceParams
  114. def setVerbose(value: Boolean): FeatureBalanceMeasure.this.type
    Definition Classes
    DataBalanceParams
  115. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  116. def toString(): String
    Definition Classes
    Identifiable → AnyRef → Any
  117. def transform(dataset: Dataset[_]): DataFrame
    Definition Classes
    FeatureBalanceMeasure → Transformer
  118. def transform(dataset: Dataset[_], paramMap: ParamMap): DataFrame
    Definition Classes
    Transformer
    Annotations
    @Since( "2.0.0" )
  119. def transform(dataset: Dataset[_], firstParamPair: ParamPair[_], otherParamPairs: ParamPair[_]*): DataFrame
    Definition Classes
    Transformer
    Annotations
    @Since( "2.0.0" ) @varargs()
  120. def transformSchema(schema: StructType): StructType
    Definition Classes
    FeatureBalanceMeasure → PipelineStage
  121. def transformSchema(schema: StructType, logging: Boolean): StructType
    Attributes
    protected
    Definition Classes
    PipelineStage
    Annotations
    @DeveloperApi()
  122. val uid: String
    Definition Classes
    FeatureBalanceMeasureBasicLogging → Identifiable
  123. def validateSchema(schema: StructType): Unit
  124. val ver: String
    Definition Classes
    BasicLogging
  125. val verbose: BooleanParam
    Definition Classes
    DataBalanceParams
  126. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  127. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  128. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  129. def write: MLWriter
    Definition Classes
    ComplexParamsWritable → MLWritable

Inherited from BasicLogging

Inherited from Wrappable

Inherited from RWrappable

Inherited from PythonWrappable

Inherited from BaseWrappable

Inherited from ComplexParamsWritable

Inherited from MLWritable

Inherited from HasLabelCol

Inherited from DataBalanceParams

Inherited from HasOutputCol

Inherited from Transformer

Inherited from PipelineStage

Inherited from Logging

Inherited from Params

Inherited from Serializable

Inherited from Serializable

Inherited from Identifiable

Inherited from AnyRef

Inherited from Any

Ungrouped