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 @@ -265,9 +265,8 @@ class BisectingKMeans @Since("2.0.0") (
val summary = new BisectingKMeansSummary(
model.transform(dataset), $(predictionCol), $(featuresCol), $(k))
model.setSummary(summary)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're here, isn't the rest of this method simpler as

model.setSummary(summary)
instr.logSuccess(model)
model

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srowen Using another val m is to keep in line with KMeans.
But after refering to more algos (GMM/LoR/LiR), I think both KMeans and BisectingKMeans can be changed according to your comments. Thanks.

val m = model.setSummary(summary)
instr.logSuccess(m)
m
instr.logSuccess(model)
model
}

@Since("2.0.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,9 @@ class KMeans @Since("1.5.0") (
val model = copyValues(new KMeansModel(uid, parentModel).setParent(this))
val summary = new KMeansSummary(
model.transform(dataset), $(predictionCol), $(featuresCol), $(k))
val m = model.setSummary(summary)
instr.logSuccess(m)
m
model.setSummary(summary)
instr.logSuccess(model)
model
}

@Since("1.5.0")
Expand Down