Using Your Own Data/APIs
To apply Private Evolution in your own data/domain/applications, most likely you only need to provide your own data (an object of pe.data.Data
) and APIs (an object of pe.api.API
).
The Private Evolution library is preloaded with popular data and APIs. You can also easily bring your own data and APIs. Here is how you can do it.
Data
Preloaded datasets: Some well-known datasets are already packaged as
pe.data.Data
classes. Please refer to this document for more details.New image datasets: You can easily load a custom image dataset from a (nested) directory with the image files using
pe.data.load_image_folder()
.New text datasets: You can easily load a custom text dataset from a CSV file using
pe.data.TextCSV
.Beyond the above: You can create a
pe.data.Data
object that holds your dataset, with two parameters,data_frame
andmetadata
, passed to the constructor. Thedata_frame
is a pandas DataFrame that holds the samples, and themetadata
is a dictionary that holds the metadata of the samples. Please refer to this document for more details.
APIs
Preloaded APIs: Some well-known APIs used in prior Private Evolution papers are already packaged as
pe.api.API
classes. Please refer to this document for more details.Beyond the above: You can create a class that inherits from
pe.api.API
and implements thepe.api.API.random_api()
andpe.api.API.variation_api()
methods. Please refer to this document for more details.