Skip to content

Commit 426eee7

Browse files
author
Alain
committed
[Minor][MLLIB] Fix a formatting bug in toString method in Node.scala
1. predict(predict.toString) has already output prefix “predict” thus it’s duplicate to print ", predict = " again 2. there are some extra spaces
1 parent d3a302d commit 426eee7

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

mllib/src/main/scala/org/apache/spark/mllib/tree/model/Node.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ class Node (
5151
var stats: Option[InformationGainStats]) extends Serializable with Logging {
5252

5353
override def toString: String = {
54-
"id = " + id + ", isLeaf = " + isLeaf + ", predict = " + predict + ", " +
55-
"impurity = " + impurity + ", split = " + split + ", stats = " + stats
54+
"id = " + id + ", isLeaf = " + isLeaf + ", " + predict + ", " +
55+
"impurity = " + impurity + ", split = " + split + ", stats = " + stats
5656
}
5757

5858
/**

mllib/src/main/scala/org/apache/spark/mllib/tree/model/Split.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ case class Split(
3939
categories: List[Double]) {
4040

4141
override def toString: String = {
42-
"Feature = " + feature + ", threshold = " + threshold + ", featureType = " + featureType +
42+
"Feature = " + feature + ", threshold = " + threshold + ", featureType = " + featureType +
4343
", categories = " + categories
4444
}
4545
}
@@ -68,4 +68,3 @@ private[tree] class DummyHighSplit(feature: Int, featureType: FeatureType)
6868
*/
6969
private[tree] class DummyCategoricalSplit(feature: Int, featureType: FeatureType)
7070
extends Split(feature, Double.MaxValue, featureType, List())
71-

0 commit comments

Comments
 (0)