Exemplo n.º 1
0
 def __init__(self,
              k,
              threshold=None,
              max_memory_size=1000,
              *args,
              **kwargs):
     AdversarialClassifier.__init__(k, threshold, max_memory_size)
     MeanShift.__init__(self, *args, **kwargs)
Exemplo n.º 2
0
 def __init__(self, 
     distance_merge     = 5.,
     cluster_all        = True,
     **args):
     self.distance_merge     = distance_merge
     Clustering.__init__(self, **args)
     MeanShift.__init__(self, 
         bandwidth   = self.distance_merge,
         bin_seeding = True,
         cluster_all = cluster_all,
     )
Exemplo n.º 3
0
    def __init__(self, **kwargs):
        self.centroids_distance = None
        if 'load' in kwargs:
            self._load(kwargs['load'])
        else:
            try:
                method = kwargs['method']
                del kwargs['method']
            except KeyError as ke:
                print(kr)
                raise

            if method == 'KMeans' or method == 'MiniBatchKMeans':
                MiniBatchKMeans.__init__(self, **kwargs)
            elif method == 'MeanShift':
                MeanShift.__init__(self, **kwargs)
            else:
                e = "No method '{}' avaiable. Please use KMeans or MeanShift".format(
                    method)
                log = Log(path='.', name='cluster_class')
                log.write(error=e, data=self)
                raise ValueError(e)