(self, scores, labels, values, colors, rownames=None)
Set the silhouette scores/labels to for display.

        Arguments
        ---------
        scores : (N,) ndarray
            The silhouette scores.
        labels : (N,) ndarray
            A ndarray (dtype=int) of label/clusters indices.
        values : list of str
            A list of label/cluster names.
        colors : (N, 3) ndarray
            A ndarray of RGB values.
        rownames : list of str, optional
            A list (len == N) of row names.
Set the silhouette scores/labels to for display.
Set the silhouette scores / labels to for display .
def setScores(self, scores, labels, values, colors, rownames=None):
        """
        Set the silhouette scores/labels to for display.

        Arguments
        ---------
        scores : (N,) ndarray
            The silhouette scores.
        labels : (N,) ndarray
            A ndarray (dtype=int) of label/clusters indices.
        values : list of str
            A list of label/cluster names.
        colors : (N, 3) ndarray
            A ndarray of RGB values.
        rownames : list of str, optional
            A list (len == N) of row names.
        """
        scores = np.asarray(scores, dtype=float)
        labels = np.asarray(labels, dtype=int)
        if rownames is not None:
            rownames = np.asarray(rownames, dtype=object)

        if not scores.ndim == labels.ndim == 1:
            raise ValueError("scores and labels must be 1 dimensional")
        if scores.shape != labels.shape:
            raise ValueError("scores and labels must have the same shape")
        if rownames is not None and rownames.shape != scores.shape:
            raise ValueError("rownames must have the same size as scores")

        Ck = np.unique(labels)
        if not Ck[0] >= 0 and Ck[-1] < len(values):
            raise ValueError(
                "All indices in `labels` must be in `range(len(values))`")
        cluster_indices = [np.flatnonzero(labels == i)
                           for i in range(len(values))]
        cluster_indices = [indices[np.argsort(scores[indices])[::-1]]
                           for indices in cluster_indices]
        groups = [
            namespace(scores=scores[indices], indices=indices, label=label,
                      rownames=(rownames[indices] if rownames is not None
                                else None),
                      color=color)
            for indices, label, color in zip(cluster_indices, values, colors)
        ]
        self.clear()
        self.__groups = groups
        self.__setup()
def setScores ( self , scores , labels , values , colors , rownames = None ) : scores = np . asarray ( scores , dtype = float ) labels = np . asarray ( labels , dtype = int ) if rownames is not None : rownames = np . asarray ( rownames , dtype = object ) if not scores . ndim == labels . ndim == 1 : raise ValueError ( "scores and labels must be 1 dimensional" ) if scores . shape != labels . shape : raise ValueError ( "scores and labels must have the same shape" ) if rownames is not None and rownames . shape != scores . shape : raise ValueError ( "rownames must have the same size as scores" ) Ck = np . unique ( labels ) if not Ck [ 0 ] >= 0 and Ck [ - 1 ] < len ( values ) : raise ValueError ( "All indices in `labels` must be in `range(len(values))`" ) cluster_indices = [ np . flatnonzero ( labels == i ) for i in range ( len ( values ) ) ] cluster_indices = [ indices [ np . argsort ( scores [ indices ] ) [ : : - 1 ] ] for indices in cluster_indices ] groups = [ namespace ( scores = scores [ indices ] , indices = indices , label = label , rownames = ( rownames [ indices ] if rownames is not None else None ) , color = color ) for indices , label , color in zip ( cluster_indices , values , colors ) ] self . clear ( ) self . __groups = groups self . __setup ( )