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 @@ -276,8 +276,7 @@ class BisectingKMeans @Since("2.0.0") (
val summary = new BisectingKMeansSummary(
model.transform(dataset), $(predictionCol), $(featuresCol), $(k))
model.setSummary(Some(summary))
// TODO: need to extend logNamedValue to support Array
instr.logNamedValue("clusterSizes", summary.clusterSizes.mkString("[", ",", "]"))
instr.logNamedValue("clusterSizes", summary.clusterSizes)
instr.logSuccess(model)
model
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,7 @@ class GaussianMixture @Since("2.0.0") (
$(predictionCol), $(probabilityCol), $(featuresCol), $(k), logLikelihood)
model.setSummary(Some(summary))
instr.logNamedValue("logLikelihood", logLikelihood)
// TODO: need to extend logNamedValue to support Array
instr.logNamedValue("clusterSizes", summary.clusterSizes.mkString("[", ",", "]"))
instr.logNamedValue("clusterSizes", summary.clusterSizes)
instr.logSuccess(model)
model
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,7 @@ class KMeans @Since("1.5.0") (
model.transform(dataset), $(predictionCol), $(featuresCol), $(k))

model.setSummary(Some(summary))
// TODO: need to extend logNamedValue to support Array
instr.logNamedValue("clusterSizes", summary.clusterSizes.mkString("[", ",", "]"))
instr.logNamedValue("clusterSizes", summary.clusterSizes)
instr.logSuccess(model)
if (handlePersistence) {
instances.unpersist()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,19 @@ private[spark] class Instrumentation[E <: Estimator[_]] private (
log(compact(render(name -> value)))
}

def logNamedValue(name: String, value: Array[String]): Unit = {
log(compact(render(name -> compact(render(value.toSeq)))))
}

def logNamedValue(name: String, value: Array[Long]): Unit = {
log(compact(render(name -> compact(render(value.toSeq)))))
}

def logNamedValue(name: String, value: Array[Double]): Unit = {
log(compact(render(name -> compact(render(value.toSeq)))))
}


/**
* Logs the successful completion of the training session.
*/
Expand Down