def set_class_weight(self, class_weight='auto', y=None):
        """ Sets the class_weight of the classifier to match y """

        if class_weight == None:
            cw = None

            try:
                self.clf.set_params(class_weight = cw)
            except __HOLE__:
                pass
                
        elif class_weight == 'auto':
            c = np.bincount(y)
            ii = np.nonzero(c)[0]
            c = c / float(c.sum())
            cw = dict(zip(ii[::-1],c[ii]))

            try:
                self.clf.set_params(class_weight = cw)
            except ValueError:
                import warnings
                warnings.warn("Tried to set class_weight, but failed. The classifier probably doesn't support it")
dataset/ETHPy150Open neurosynth/neurosynth/neurosynth/analysis/classify.py/Classifier.set_class_weight