開始使用免費開始

使用隱私預算

diffprivlib 套件包含可用來探索資料的統計函式,例如 mean(),它會計算陣列元素的「差分隱私」平均值。請使用 diffprivlibtools 模組提供的函式。

在這裡,你會使用隱私預算會計器 acc,在對 Heart Failure Prediction 資料集中的陣列 ages 計算「私有平均」時,追蹤隱私損失。

diffprivlibtools 模組與 BudgetAccountant 類別已經載入。

本練習屬於課程

Data Privacy and Anonymization in Python

檢視課程

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Initialize budget accountant with epsilon of 1.2
acc = ____
編輯並執行程式碼