Closed dzlab closed 3 years ago
Hi @dzlab,
If you need the actual centroid coordinates, we will expose it in SW-2639.
If you need them for calculation certain clustering metrics, you can maybe leverage metrics that SW provides since the version 3.34.0.1-1
.
import ai.h2o.sparkling.ml.metrics.H2OClusteringMetrics
val clusteringMetrics = model.getTrainingMetricsObject().asInstanceOf[H2OClusteringMetrics]
I'm training a KMeans model in SW with something like this https://docs.h2o.ai/sparkling-water/3.0/latest-stable/doc/ml/sw_kmeans.html When I get back after training a
H2OKMeansMOJOModel
I cannot find a way to get the centroids, but it seems that H2O provides an API calledcenters()
that return them see https://github.com/h2oai/h2o-3/blob/master/h2o-py/demos/constrained_kmeans_demo_cluto.ipynb@mn-mikke How can I get the centroids in SW similarly to what H2O is providing?