def __init__(
        self,
        estimator: "CLASSIFIER_TYPE" | "REGRESSOR_TYPE",
        membership_attack: MembershipInferenceAttack,
        attack_feature: int | slice = 0,
    ):
        """
        Create an AttributeInferenceMembership attack instance.

        :param estimator: Target estimator.
        :param membership_attack: The membership inference attack to use. Should be fit/calibrated in advance, and
                                  should support returning probabilities. Should also support the target estimator.
        :param attack_feature: The index of the feature to be attacked or a slice representing multiple indexes in
                               case of a one-hot encoded feature.
        """
        super().__init__(estimator=estimator, attack_feature=attack_feature)
        if not membership_attack.is_estimator_valid(estimator, estimator_requirements=self.estimator_requirements):
            raise EstimatorError(membership_attack.__class__, membership_attack.estimator_requirements, estimator)

        self.membership_attack = membership_attack
        self._check_params()

        Create an AttributeInferenceMembership attack instance.

        :param estimator: Target estimator.
        :param membership_attack: The membership inference attack to use. Should be fit/calibrated in advance, and
                                  should support returning probabilities. Should also support the target estimator.
        :param attack_feature: The index of the feature to be attacked or a slice representing multiple indexes in
                               case of a one-hot encoded feature.
        
art/attacks/inference/attribute_inference/meminf_based.py