Geometric Mechanism Local DP for SKLearn Pipeline
Feature Description
Enabling the use of Geometric Mechanism for Local DP in SKLean Pipeline. This should be in the form of an "operator" that should be inserted between the layers in SKLearn's Pipeline class.
Additional Context
Current development for the SKLean Pipeline is in branch feature/machine-learning-1.
Preferably, the name of the "operator" imported from PyDP should be called GeometricMechanism. The use should be as seamless and convenient as possible in SKLearn's Pipeline class. For example:
pipe = Pipeline([
('scaler', StandardScaler()),
('laplace', GeometricMechanism()),
('nb', GaussianNB())
])
For more examples, please have look at the notebook example of Laplace Mechanism's implementation.
As starting guidance, please refer to the source code for LaplaceMechanism in here.
Note: the Geometric Mechanism would most likely need different parameters to be initialized compare to the Laplace Mechanism.
Due to the nature of how we implement the Geometric class, it seems that we can only support datasets with categorical features. Alternatively, we can use GeometricDistribution direct from Google DP, but that means we also have to modify the already implemented LaplaceMechanism class so that it also uses LaplaceDistribution from Google DP.
What do you think? @chinmayshah99