h2o-py/h2o/model/clustering.py
def size(self, train=False, valid=False, xval=False):
        """
        Get the sizes of each cluster.

        If all are False (default), then return the training metric value.
        If more than one options is set to True, then return a dictionary of metrics where
        the keys are "train", "valid", and "xval".

        :param bool train: If True, return the cluster sizes for the training data.
        :param bool valid: If True, return the cluster sizes for the validation data.
        :param bool xval: If True, return the cluster sizes for each of the cross-validated splits.

        :returns: The cluster sizes for the specified key(s).
        """
        tm = ModelBase._get_metrics(self, train, valid, xval)
        m = {}
        for k, v in tm.items():
            m[k] = None if v is None else [v[2] for v in v._metric_json["centroid_stats"].cell_values]
        return list(m.values())[0] if len(m) == 1 else m
def size(self, train=False, valid=False, xval=False):
        tm = ModelBase._get_metrics(self, train, valid, xval)
        m = {}
        for k, v in tm.items():
            m[k] = None if v is None else [v[2] for v in v._metric_json["centroid_stats"].cell_values]
        return list(m.values())[0] if len(m) == 1 else m
def size ( self , train = False , valid = False , xval = False ) : tm = ModelBase . _get_metrics ( self , train , valid , xval ) m = { } for k , v in tm . items ( ) : m [ k ] = None if v is None else [ v [ 2 ] for v in v . _metric_json [ "centroid_stats" ] . cell_values ] return list ( m . values ( ) ) [ 0 ] if len ( m ) == 1 else m
Get the sizes of each cluster.

        If all are False (default), then return the training metric value.
        If more than one options is set to True, then return a dictionary of metrics where
        the keys are "train", "valid", and "xval".

        :param bool train: If True, return the cluster sizes for the training data.
        :param bool valid: If True, return the cluster sizes for the validation data.
        :param bool xval: If True, return the cluster sizes for each of the cross-validated splits.

        :returns: The cluster sizes for the specified key(s).
Get the sizes of each cluster .