Пример #1
0
 def __init__(self, operator=None, **hyperparams):
     if operator is None:
         raise ValueError("Operator is a required argument.")
     self._hyperparams = hyperparams
     resampler_instance = OrigModel(**self._hyperparams)
     super(EditedNearestNeighboursImpl,
           self).__init__(operator=operator, resampler=resampler_instance)
Пример #2
0
    def __init__(self, operator = None, sampling_strategy='auto', random_state=None, 
                n_neighbors=None, n_seeds_S=1, n_jobs=1):
        if operator is None:
            raise ValueError("Operator is a required argument.")

        self._hyperparams = {
            'sampling_strategy': sampling_strategy,
            'random_state': random_state,
            'n_neighbors': n_neighbors,
            'n_seeds_S': n_seeds_S,
            'n_jobs': n_jobs}
    
        resampler_instance = OrigModel(**self._hyperparams)
        super(CondensedNearestNeighbourImpl, self).__init__(
            operator = operator,
            resampler = resampler_instance)
Пример #3
0
    def __init__(self, operator = None, sampling_strategy='auto', random_state=None, 
                n_neighbors=3, max_iter=100, kind_sel='all', n_jobs=1):
        if operator is None:
            raise ValueError("Operator is a required argument.")

        self._hyperparams = {
            'sampling_strategy': sampling_strategy,
            'random_state': random_state,
            'n_neighbors': n_neighbors,
            'max_iter': max_iter,
            'kind_sel': kind_sel,
            'n_jobs': n_jobs}
    
        resampler_instance = OrigModel(**self._hyperparams)
        super(RepeatedEditedNearestNeighboursImpl, self).__init__(
            operator = operator,
            resampler = resampler_instance)
Пример #4
0
    def __init__(self,
                 operator=None,
                 estimator=None,
                 sampling_strategy='auto',
                 random_state=None,
                 cv=5,
                 n_jobs=1):
        if operator is None:
            raise ValueError("Operator is a required argument.")

        self._hyperparams = {
            'estimator': estimator,
            'sampling_strategy': sampling_strategy,
            'random_state': random_state,
            'cv': cv,
            'n_jobs': n_jobs
        }

        resampler_instance = OrigModel(**self._hyperparams)
        super(InstanceHardnessThresholdImpl,
              self).__init__(operator=operator, resampler=resampler_instance)
Пример #5
0
    def __init__(
        self,
        operator=None,
        estimator=None,
        sampling_strategy="auto",
        random_state=None,
        cv=5,
        n_jobs=1,
    ):
        if operator is None:
            raise ValueError("Operator is a required argument.")

        self._hyperparams = {
            "estimator": estimator,
            "sampling_strategy": sampling_strategy,
            "random_state": random_state,
            "cv": cv,
            "n_jobs": n_jobs,
        }

        resampler_instance = OrigModel(**self._hyperparams)
        super(_InstanceHardnessThresholdImpl,
              self).__init__(operator=operator, resampler=resampler_instance)
Пример #6
0
    def __init__(
        self,
        operator=None,
        sampling_strategy="auto",
        random_state=None,
        n_neighbors=None,
        n_seeds_S=1,
        n_jobs=1,
    ):
        if operator is None:
            raise ValueError("Operator is a required argument.")

        self._hyperparams = {
            "sampling_strategy": sampling_strategy,
            "random_state": random_state,
            "n_neighbors": n_neighbors,
            "n_seeds_S": n_seeds_S,
            "n_jobs": n_jobs,
        }

        resampler_instance = OrigModel(**self._hyperparams)
        super(CondensedNearestNeighbourImpl,
              self).__init__(operator=operator, resampler=resampler_instance)
Пример #7
0
    def __init__(self,
                 operator=None,
                 sampling_strategy='auto',
                 random_state=None,
                 n_neighbors=3,
                 kind_sel='all',
                 allow_minority=False,
                 n_jobs=1):
        if operator is None:
            raise ValueError("Operator is a required argument.")

        self._hyperparams = {
            'sampling_strategy': sampling_strategy,
            'random_state': random_state,
            'n_neighbors': n_neighbors,
            'kind_sel': kind_sel,
            'allow_minority': allow_minority,
            'n_jobs': n_jobs
        }

        resampler_instance = OrigModel(**self._hyperparams)
        super(AllKNNImpl, self).__init__(operator=operator,
                                         resampler=resampler_instance)