Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ object ChiSqSelectorExample {
// $example off$

println("filtered data: ")
filteredData.foreach(x => println(x))
filteredData.collect.foreach(x => println(x))

sc.stop()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ object ElementwiseProductExample {
// $example off$

println("transformedData: ")
transformedData.foreach(x => println(x))
transformedData.collect.foreach(x => println(x))

println("transformedData2: ")
transformedData2.foreach(x => println(x))
transformedData2.collect.foreach(x => println(x))

sc.stop()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ object NormalizerExample {
// $example off$

println("data1: ")
data1.foreach(x => println(x))
data1.collect.foreach(x => println(x))

println("data2: ")
data2.foreach(x => println(x))
data2.collect.foreach(x => println(x))

sc.stop()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ object StandardScalerExample {
// $example off$

println("data1: ")
data1.foreach(x => println(x))
data1.collect.foreach(x => println(x))

println("data2: ")
data2.foreach(x => println(x))
data2.collect.foreach(x => println(x))

sc.stop()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ object TFIDFExample {
// $example off$

println("tfidf: ")
tfidf.foreach(x => println(x))
tfidf.collect.foreach(x => println(x))

println("tfidfIgnore: ")
tfidfIgnore.foreach(x => println(x))
tfidfIgnore.collect.foreach(x => println(x))

sc.stop()
}
Expand Down