Esempio n. 1
0
 def predict(self, key_data):
     ref_key_attributes = closest_neighbors(self.synthetic_dict.keys(),
                                            key_data)
     ref_sensitive_attributes = []
     for key in ref_key_attributes:
         ref_sensitive_attributes.extend(self.synthetic_dict[key])
     return majority(ref_sensitive_attributes)
Esempio n. 2
0
    def predict(self, key_data):
        """Make a prediction of the sensitive data given keys.

        Args:
            key_data(tuple):
                The key data.

        Returns:
            tuple:
                The predicted sensitive data.
        """
        predictions = [attacker.predict(key_data) for attacker in self.attackers]
        return majority(predictions)
Esempio n. 3
0
    def predict(self, key_data):
        """Make a prediction of the sensitive data given keys.

        Args:
            key_data (tuple):
                The key data.

        Returns:
            tuple:
                The predicted sensitive data.
        """
        if key_data not in self.synthetic_dict:
            return None  # target key attribute not found in synthetic table

        return majority(self.synthetic_dict[key_data])
Esempio n. 4
0
    def predict(self, key_data):
        """Make a prediction of the sensitive data given keys.

        Args:
            key_data (tuple):
                The key data.

        Returns:
            tuple:
                The predicted sensitive data.
        """
        ref_key_attributes = closest_neighbors(self.synthetic_dict.keys(), key_data)
        ref_sensitive_attributes = []
        for key in ref_key_attributes:
            ref_sensitive_attributes.extend(self.synthetic_dict[key])

        return majority(ref_sensitive_attributes)
Esempio n. 5
0
 def predict(self, key_data):
     predictions = [
         attacker.predict(key_data) for attacker in self.attackers
     ]
     return majority(predictions)
Esempio n. 6
0
 def predict(self, key_data):
     if key_data not in self.synthetic_dict:
         return None  # target key attribute not found in synthetic table
     return majority(self.synthetic_dict[key_data])