class BinaryClassificationMetrics extends Logging
Evaluator for binary classification.
- Annotations
- @Since("1.0.0")
- Source
- BinaryClassificationMetrics.scala
- Alphabetic
- By Inheritance
- BinaryClassificationMetrics
- Logging
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new BinaryClassificationMetrics(scoreAndLabels: RDD[(Double, Double)])
Defaults
numBins
to 0.Defaults
numBins
to 0.- Annotations
- @Since("1.0.0")
- new BinaryClassificationMetrics(scoreAndLabels: RDD[_ <: Product], numBins: Int = 1000)
- scoreAndLabels
an RDD of (score, label) or (score, label, weight) tuples.
- numBins
if greater than 0, then the curves (ROC curve, PR curve) computed internally will be down-sampled to this many "bins". If 0, no down-sampling will occur. This is useful because the curve contains a point for each distinct score in the input, and this could be as large as the input itself -- millions of points or more, when thousands may be entirely sufficient to summarize the curve. After down-sampling, the curves will instead be made of approximately
numBins
points instead. Points are made from bins of equal numbers of consecutive points. The size of each bin isfloor(scoreAndLabels.count() / numBins)
, which means the resulting number of bins may not exactly equal numBins. The last bin in each partition may be smaller as a result, meaning there may be an extra sample at partition boundaries.
- Annotations
- @Since("3.0.0")
Type Members
- implicit class LogStringContext extends AnyRef
- Definition Classes
- Logging
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def areaUnderPR(): Double
Computes the area under the precision-recall curve.
Computes the area under the precision-recall curve.
- Annotations
- @Since("1.0.0")
- def areaUnderROC(): Double
Computes the area under the receiver operating characteristic (ROC) curve.
Computes the area under the receiver operating characteristic (ROC) curve.
- Annotations
- @Since("1.0.0")
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def fMeasureByThreshold(): RDD[(Double, Double)]
Returns the (threshold, F-Measure) curve with beta = 1.0.
Returns the (threshold, F-Measure) curve with beta = 1.0.
- Annotations
- @Since("1.0.0")
- def fMeasureByThreshold(beta: Double): RDD[(Double, Double)]
Returns the (threshold, F-Measure) curve.
Returns the (threshold, F-Measure) curve.
- beta
the beta factor in F-Measure computation.
- returns
an RDD of (threshold, F-Measure) pairs.
- Annotations
- @Since("1.0.0")
- See also
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
- Attributes
- protected
- Definition Classes
- Logging
- def initializeLogIfNecessary(isInterpreter: Boolean): Unit
- Attributes
- protected
- Definition Classes
- Logging
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isTraceEnabled(): Boolean
- Attributes
- protected
- Definition Classes
- Logging
- def log: Logger
- Attributes
- protected
- Definition Classes
- Logging
- def logDebug(msg: => String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logDebug(entry: LogEntry, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logDebug(entry: LogEntry): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logDebug(msg: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logError(msg: => String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logError(entry: LogEntry, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logError(entry: LogEntry): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logError(msg: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logInfo(msg: => String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logInfo(entry: LogEntry, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logInfo(entry: LogEntry): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logInfo(msg: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logName: String
- Attributes
- protected
- Definition Classes
- Logging
- def logTrace(msg: => String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logTrace(entry: LogEntry, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logTrace(entry: LogEntry): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logTrace(msg: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logWarning(msg: => String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logWarning(entry: LogEntry, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logWarning(entry: LogEntry): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logWarning(msg: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- val numBins: Int
- Annotations
- @Since("1.3.0")
- def pr(): RDD[(Double, Double)]
Returns the precision-recall curve, which is an RDD of (recall, precision), NOT (precision, recall), with (0.0, p) prepended to it, where p is the precision associated with the lowest recall on the curve.
Returns the precision-recall curve, which is an RDD of (recall, precision), NOT (precision, recall), with (0.0, p) prepended to it, where p is the precision associated with the lowest recall on the curve.
- Annotations
- @Since("1.0.0")
- See also
- def precisionByThreshold(): RDD[(Double, Double)]
Returns the (threshold, precision) curve.
Returns the (threshold, precision) curve.
- Annotations
- @Since("1.0.0")
- def recallByThreshold(): RDD[(Double, Double)]
Returns the (threshold, recall) curve.
Returns the (threshold, recall) curve.
- Annotations
- @Since("1.0.0")
- def roc(): RDD[(Double, Double)]
Returns the receiver operating characteristic (ROC) curve, which is an RDD of (false positive rate, true positive rate) with (0.0, 0.0) prepended and (1.0, 1.0) appended to it.
Returns the receiver operating characteristic (ROC) curve, which is an RDD of (false positive rate, true positive rate) with (0.0, 0.0) prepended and (1.0, 1.0) appended to it.
- Annotations
- @Since("1.0.0")
- See also
- val scoreAndLabels: RDD[_ <: Product]
- Annotations
- @Since("1.3.0")
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def thresholds(): RDD[Double]
Returns thresholds in descending order.
Returns thresholds in descending order.
- Annotations
- @Since("1.0.0")
- def toString(): String
- Definition Classes
- AnyRef → Any
- def unpersist(): Unit
Unpersist intermediate RDDs used in the computation.
Unpersist intermediate RDDs used in the computation.
- Annotations
- @Since("1.0.0")
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def withLogContext(context: HashMap[String, String])(body: => Unit): Unit
- Attributes
- protected
- Definition Classes
- Logging
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)