Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/15149#discussion_r79412702
--- Diff:
mllib/src/test/scala/org/apache/spark/ml/classification/ProbabilisticClassifierSuite.scala
---
@@ -56,6 +56,21 @@ class ProbabilisticClassifierSuite extends SparkFunSuite
{
val testModel = new TestProbabilisticClassificationModel("myuid", 2, 2)
assert(testModel.friendlyPredict(Vectors.dense(Array(1.0, 2.0))) ===
1.0)
}
+
+ test("test tiebreak") {
+ val testModel = new TestProbabilisticClassificationModel("myuid", 2, 2)
+ .setThresholds(Array(0.4, 0.4))
+ assert(testModel.friendlyPredict(Vectors.dense(Array(0.6, 0.6))) ===
0.0)
+ }
+
+ test("bad thresholds") {
+ intercept[IllegalArgumentException] {
--- End diff --
Sounds good.
BTW I'm finding that many cases use thresholds that sum to 1. Is it
actually important to prohibit this? I don't see that thresholds/cutoffs are
actually interpreted as a probability distribution or anything.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]