aboutsummaryrefslogtreecommitdiff
path: root/mllib
diff options
context:
space:
mode:
authorShuo Xiang <shuoxiangpub@gmail.com>2015-05-21 12:09:44 -0700
committerXiangrui Meng <meng@databricks.com>2015-05-21 12:09:44 -0700
commit4f572008f804068c1a81cc334ff2367dbeae6493 (patch)
treef12f4989dd0987973bbc4a90bb1273274a74b421 /mllib
parent699906e538a3d03636adab546ca86d06d5d89293 (diff)
downloadspark-4f572008f804068c1a81cc334ff2367dbeae6493.tar.gz
spark-4f572008f804068c1a81cc334ff2367dbeae6493.tar.bz2
spark-4f572008f804068c1a81cc334ff2367dbeae6493.zip
[SPARK-7793] [MLLIB] Use getOrElse for getting the threshold of SVM model
same issue and fix as in Spark-7694. Author: Shuo Xiang <shuoxiangpub@gmail.com> Closes #6321 from coderxiang/nb and squashes the following commits: a5e6de4 [Shuo Xiang] use getOrElse for svmmodel.tostring 2cb0177 [Shuo Xiang] Merge remote-tracking branch 'upstream/master' into nb 5f109b4 [Shuo Xiang] Merge remote-tracking branch 'upstream/master' c5c5bfe [Shuo Xiang] Merge remote-tracking branch 'upstream/master' 98804c9 [Shuo Xiang] fix bug in topBykey and update test
Diffstat (limited to 'mllib')
-rw-r--r--mllib/src/main/scala/org/apache/spark/mllib/classification/SVM.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/mllib/classification/SVM.scala b/mllib/src/main/scala/org/apache/spark/mllib/classification/SVM.scala
index 33104cf06c..3484855607 100644
--- a/mllib/src/main/scala/org/apache/spark/mllib/classification/SVM.scala
+++ b/mllib/src/main/scala/org/apache/spark/mllib/classification/SVM.scala
@@ -89,7 +89,7 @@ class SVMModel (
override protected def formatVersion: String = "1.0"
override def toString: String = {
- s"${super.toString}, numClasses = 2, threshold = ${threshold.get}"
+ s"${super.toString}, numClasses = 2, threshold = ${threshold.getOrElse("None")}"
}
}