Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-9720] [ML] Identifiable types need UID in toString methods #8062

Closed
wants to merge 2 commits into from
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 @@ -144,7 +144,7 @@ final class DecisionTreeClassificationModel private[ml] (
}

override def toString: String = {
s"DecisionTreeClassificationModel of depth $depth with $numNodes nodes"
s"DecisionTreeClassificationModel (uid=$uid) of depth $depth with $numNodes nodes"
}

/** (private[ml]) Convert to a model in the old API */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ final class GBTClassificationModel(
}

override def toString: String = {
s"GBTClassificationModel with $numTrees trees"
s"GBTClassificationModel (uid=$uid) with $numTrees trees"
}

/** (private[ml]) Convert to a model in the old API */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class NaiveBayesModel private[ml] (
}

override def toString: String = {
s"NaiveBayesModel with ${pi.size} classes"
s"NaiveBayesModel (uid=$uid) with ${pi.size} classes"
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ final class RandomForestClassificationModel private[ml] (
}

override def toString: String = {
s"RandomForestClassificationModel with $numTrees trees"
s"RandomForestClassificationModel (uid=$uid) with $numTrees trees"
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class RFormula(override val uid: String) extends Estimator[RFormulaModel] with R

override def copy(extra: ParamMap): RFormula = defaultCopy(extra)

override def toString: String = s"RFormula(${get(formula)})"
override def toString: String = s"RFormula(${get(formula)}) (uid=$uid)"
}

/**
Expand Down Expand Up @@ -170,7 +170,7 @@ class RFormulaModel private[feature](
override def copy(extra: ParamMap): RFormulaModel = copyValues(
new RFormulaModel(uid, resolvedFormula, pipelineModel))

override def toString: String = s"RFormulaModel(${resolvedFormula})"
override def toString: String = s"RFormulaModel(${resolvedFormula}) (uid=$uid)"

private def transformLabel(dataset: DataFrame): DataFrame = {
val labelName = resolvedFormula.label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ final class DecisionTreeRegressionModel private[ml] (
}

override def toString: String = {
s"DecisionTreeRegressionModel of depth $depth with $numNodes nodes"
s"DecisionTreeRegressionModel (uid=$uid) of depth $depth with $numNodes nodes"
}

/** Convert to a model in the old API */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ final class GBTRegressionModel(
}

override def toString: String = {
s"GBTRegressionModel with $numTrees trees"
s"GBTRegressionModel (uid=$uid) with $numTrees trees"
}

/** (private[ml]) Convert to a model in the old API */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ final class RandomForestRegressionModel private[ml] (
}

override def toString: String = {
s"RandomForestRegressionModel with $numTrees trees"
s"RandomForestRegressionModel (uid=$uid) with $numTrees trees"
}

/**
Expand Down