Esempio n. 1
0
    def __init__(self, compute_driver_class, data_driver, epsilon,
                 blocker_name='NaiveDataBlocker', blocker_args=None):
        
        if not issubclass(compute_driver_class, GuptComputeDriver):
            raise log.exception("Argument compute_driver is not subclassed from GuptComputeDriver")
        if not isinstance(data_driver, GuptDataDriver):
            raise logger.exception("Argument data_driver is not subclassed from GuptDataDriver")
        
        self.compute_driver_class = compute_driver_class
        self.data_driver = data_driver
        
        if not blocker_args or isiterable(blocker_args):
            self.blocker_args = blocker_args
        else:
            self.blocker_args = (blocker_args, )
        self.blocker = DataBlockerFactory.get_blocker(blocker_name)(self.blocker_args)
        
        self.sensitivity_factor = self.blocker.get_sensitivity_factor()
        logger.debug("The sensitivity of the output has changed by a factor of %f because of blocking" %
                     (self.sensitivity_factor))
        self.epsilon = float(epsilon)

        logger.info("Initializing Gupt Runtime environment for analysis of the " +
                    str(data_driver) + " data set " +
                    "using the " + compute_driver_class.__name__ + " computation " +
                    "with an epsilon value of " + str(epsilon))                    
Esempio n. 2
0
    def __init__(self,
                 compute_driver_class,
                 data_driver,
                 epsilon,
                 blocker_name='NaiveDataBlocker',
                 blocker_args=None):

        if not issubclass(compute_driver_class, GuptComputeDriver):
            raise log.exception(
                "Argument compute_driver is not subclassed from GuptComputeDriver"
            )
        if not isinstance(data_driver, GuptDataDriver):
            raise logger.exception(
                "Argument data_driver is not subclassed from GuptDataDriver")

        self.compute_driver_class = compute_driver_class
        self.data_driver = data_driver

        if not blocker_args or isiterable(blocker_args):
            self.blocker_args = blocker_args
        else:
            self.blocker_args = (blocker_args, )
        self.blocker = DataBlockerFactory.get_blocker(blocker_name)(
            self.blocker_args)

        self.sensitivity_factor = self.blocker.get_sensitivity_factor()
        logger.debug(
            "The sensitivity of the output has changed by a factor of %f because of blocking"
            % (self.sensitivity_factor))
        self.epsilon = float(epsilon)

        logger.info(
            "Initializing Gupt Runtime environment for analysis of the " +
            str(data_driver) + " data set " + "using the " +
            compute_driver_class.__name__ + " computation " +
            "with an epsilon value of " + str(epsilon))
Esempio n. 3
0
 def get_data_blockers():
     return DataBlockerFactory.get_blocker_names()
Esempio n. 4
0
 def get_data_blockers():
     return DataBlockerFactory.get_blocker_names()