74b143eea73349af4f3d3d111e0890c496eef19a,art/attacks/inference/membership_inference.py,MembershipInferenceBlackBox,__init__,#MembershipInferenceBlackBox#Any#Any#Any#Any#,162

Before Change


        
        super(MembershipInferenceBlackBox, self).__init__(estimator=classifier)

        if input_type not in ["prediction", "loss"]:
            raise ValueError("Illegal value for parameter `input_type`.")

        self.input_type = input_type

        if attack_model:
            if ClassifierMixin not in type(attack_model).__mro__:
                raise TypeError("Attack model must be of type Classifier.")
            self.attack_model = attack_model
            self.default_model = False
            self.attack_model_type = None
        else:
            self.default_model = True
            self.attack_model_type = attack_model_type
            if attack_model_type == "nn":
                if input_type == "prediction":
                    self.attack_model = MembershipInferenceAttackModel(classifier.nb_classes)
                else:
                    self.attack_model = MembershipInferenceAttackModel(classifier.nb_classes, 1)
                self.epochs = 100
                self.bs = 100
                self.lr = 0.0001
            elif attack_model_type == "rf":
                self.attack_model = RandomForestClassifier()
            elif attack_model_type == "gb":
                self.attack_model = GradientBoostingClassifier()
            else:
                raise ValueError("Illegal value for parameter `attack_model_type`.")

    def fit(self, x: np.ndarray, y: np.ndarray, test_x: np.ndarray, test_y: np.ndarray, **kwargs) -> np.ndarray:
        
        Infer membership in the training set of the target estimator.

After Change


        self.attack_model_type = attack_model_type
        self.attack_model = attack_model

        self._check_params()

        if self.attack_model:
            self.default_model = False
            self.attack_model_type = None
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 74b143eea73349af4f3d3d111e0890c496eef19a
Time: 2020-08-25
Author: abigailt@il.ibm.com
File Name: art/attacks/inference/membership_inference.py
Class Name: MembershipInferenceBlackBox
Method Name: __init__


Project Name: glm-tools/pyglmnet
Commit Name: 0157bae83c487a2838954f74f20deca777099757
Time: 2019-10-19
Author: mainakjas@gmail.com
File Name: pyglmnet/pyglmnet.py
Class Name: GLM
Method Name: __init__


Project Name: glm-tools/pyglmnet
Commit Name: 0157bae83c487a2838954f74f20deca777099757
Time: 2019-10-19
Author: mainakjas@gmail.com
File Name: pyglmnet/pyglmnet.py
Class Name: GLMCV
Method Name: __init__