Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ object BinaryClassificationMetricsExample {

// Precision by threshold
val precision = metrics.precisionByThreshold
precision.foreach { case (t, p) =>
precision.collect.foreach { case (t, p) =>
println(s"Threshold: $t, Precision: $p")
}

// Recall by threshold
val recall = metrics.recallByThreshold
recall.foreach { case (t, r) =>
recall.collect.foreach { case (t, r) =>
println(s"Threshold: $t, Recall: $r")
}

Expand All @@ -74,13 +74,13 @@ object BinaryClassificationMetricsExample {

// F-measure
val f1Score = metrics.fMeasureByThreshold
f1Score.foreach { case (t, f) =>
f1Score.collect.foreach { case (t, f) =>
println(s"Threshold: $t, F-score: $f, Beta = 1")
}

val beta = 0.5
val fScore = metrics.fMeasureByThreshold(beta)
f1Score.foreach { case (t, f) =>
fScore.collect.foreach { case (t, f) =>
println(s"Threshold: $t, F-score: $f, Beta = 0.5")
}

Expand Down