(self)
Set :attr:`clusterer_` depending on the value of `clusterer`.

        Also verify whether calculations are to be based on precomputed
        metric/affinity information or not.
Set :attr:`clusterer_` depending on the value of `clusterer`.
Set : attr : clusterer_ depending on the value of clusterer .
def _validate_clusterer(self):
        """Set :attr:`clusterer_` depending on the value of `clusterer`.

        Also verify whether calculations are to be based on precomputed
        metric/affinity information or not.

        """
        if not isinstance(self.clusterer, ClusterMixin):
            raise TypeError("`clusterer` must be an instance of "
                            "sklearn.base.ClusterMixin.")
        params = [param for param in ['metric', 'affinity']
                  if param in signature(self.clusterer.__init__).parameters]
        precomputed = [(getattr(self.clusterer, param) == 'precomputed')
                       for param in params]
        if not precomputed:
            self._precomputed = False
        elif len(precomputed) == 1:
            self._precomputed = precomputed[0]
        else:
            raise NotImplementedError("Behaviour when metric and affinity "
                                      "are both set to 'precomputed' not yet "
                                      "implemented by ParallelClustering.")
def _validate_clusterer ( self ) : if not isinstance ( self . clusterer , ClusterMixin ) : raise TypeError ( "`clusterer` must be an instance of " "sklearn.base.ClusterMixin." ) params = [ param for param in [ 'metric' , 'affinity' ] if param in signature ( self . clusterer . __init__ ) . parameters ] precomputed = [ ( getattr ( self . clusterer , param ) == 'precomputed' ) for param in params ] if not precomputed : self . _precomputed = False elif len ( precomputed ) == 1 : self . _precomputed = precomputed [ 0 ] else : raise NotImplementedError ( "Behaviour when metric and affinity " "are both set to 'precomputed' not yet " "implemented by ParallelClustering." )