updating rust dependencies and updating the code accordingly

This commit is contained in:
Rodrigo Racanicci 2023-03-16 13:41:37 -03:00
Родитель 1916a9194a
Коммит 669c53a846
16 изменённых файлов: 633 добавлений и 470 удалений

221
Cargo.lock сгенерированный
Просмотреть файл

@ -4,11 +4,11 @@ version = 3
[[package]]
name = "ahash"
version = "0.7.6"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47"
checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f"
dependencies = [
"getrandom",
"cfg-if",
"once_cell",
"version_check",
]
@ -46,7 +46,7 @@ version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
dependencies = [
"hermit-abi",
"hermit-abi 0.1.19",
"libc",
"winapi",
]
@ -93,6 +93,12 @@ version = "1.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f5715e491b5a1598fc2bef5a606847b5dc1d48ea625bd3c02c00de8285591da"
[[package]]
name = "cc"
version = "1.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
[[package]]
name = "cfg-if"
version = "1.0.0"
@ -154,7 +160,7 @@ dependencies = [
"cfg-if",
"crossbeam-utils",
"lazy_static",
"memoffset",
"memoffset 0.6.5",
"scopeguard",
]
@ -215,6 +221,40 @@ dependencies = [
"termcolor",
]
[[package]]
name = "env_logger"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0"
dependencies = [
"humantime",
"is-terminal",
"log",
"regex",
"termcolor",
]
[[package]]
name = "errno"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1"
dependencies = [
"errno-dragonfly",
"libc",
"winapi",
]
[[package]]
name = "errno-dragonfly"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
dependencies = [
"cc",
"libc",
]
[[package]]
name = "fnv"
version = "1.0.7"
@ -236,9 +276,9 @@ dependencies = [
[[package]]
name = "hashbrown"
version = "0.12.3"
version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e"
dependencies = [
"ahash",
]
@ -261,6 +301,12 @@ dependencies = [
"libc",
]
[[package]]
name = "hermit-abi"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286"
[[package]]
name = "humantime"
version = "2.1.0"
@ -286,6 +332,28 @@ dependencies = [
"web-sys",
]
[[package]]
name = "io-lifetimes"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfa919a82ea574332e2de6e74b4c36e74d41982b335080fa59d4ef31be20fdf3"
dependencies = [
"libc",
"windows-sys",
]
[[package]]
name = "is-terminal"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21b6b32576413a8e69b90e952e4a026476040d81017b80445deda5f2d3921857"
dependencies = [
"hermit-abi 0.3.1",
"io-lifetimes",
"rustix",
"windows-sys",
]
[[package]]
name = "itertools"
version = "0.10.1"
@ -318,9 +386,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
version = "0.2.108"
version = "0.2.140"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8521a1b57e76b1ec69af7599e75e38e7b7fad6610f037db8c79b127201b5d119"
checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c"
[[package]]
name = "libm"
@ -328,6 +396,12 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a"
[[package]]
name = "linux-raw-sys"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4"
[[package]]
name = "lock_api"
version = "0.4.5"
@ -348,9 +422,9 @@ dependencies = [
[[package]]
name = "lru"
version = "0.8.1"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909"
checksum = "03f1160296536f10c833a82dca22267d5486734230d47bf00bf435885814ba1e"
dependencies = [
"hashbrown",
]
@ -379,6 +453,15 @@ dependencies = [
"autocfg",
]
[[package]]
name = "memoffset"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1"
dependencies = [
"autocfg",
]
[[package]]
name = "nalgebra"
version = "0.29.0"
@ -454,15 +537,15 @@ version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
dependencies = [
"hermit-abi",
"hermit-abi 0.1.19",
"libc",
]
[[package]]
name = "once_cell"
version = "1.8.0"
version = "1.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56"
checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
[[package]]
name = "pac-synth"
@ -547,14 +630,14 @@ dependencies = [
[[package]]
name = "pyo3"
version = "0.17.2"
version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "201b6887e5576bf2f945fe65172c1fcbf3fcf285b23e4d71eb171d9736e38d32"
checksum = "06a3d8e8a46ab2738109347433cb7b96dffda2e4a218b03ef27090238886b147"
dependencies = [
"cfg-if",
"indoc",
"libc",
"memoffset",
"memoffset 0.8.0",
"parking_lot",
"pyo3-build-config",
"pyo3-ffi",
@ -564,9 +647,9 @@ dependencies = [
[[package]]
name = "pyo3-build-config"
version = "0.17.2"
version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf0708c9ed01692635cbf056e286008e5a2927ab1a5e48cdd3aeb1ba5a6fef47"
checksum = "75439f995d07ddfad42b192dfcf3bc66a7ecfd8b4a1f5f6f046aa5c2c5d7677d"
dependencies = [
"once_cell",
"target-lexicon",
@ -574,9 +657,9 @@ dependencies = [
[[package]]
name = "pyo3-ffi"
version = "0.17.2"
version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90352dea4f486932b72ddf776264d293f85b79a1d214de1d023927b41461132d"
checksum = "839526a5c07a17ff44823679b68add4a58004de00512a95b6c1c98a6dcac0ee5"
dependencies = [
"libc",
"pyo3-build-config",
@ -584,9 +667,9 @@ dependencies = [
[[package]]
name = "pyo3-macros"
version = "0.17.2"
version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7eb24b804a2d9e88bfcc480a5a6dd76f006c1e3edaf064e8250423336e2cd79d"
checksum = "bd44cf207476c6a9760c4653559be4f206efafb924d3e4cbf2721475fc0d6cc5"
dependencies = [
"proc-macro2",
"pyo3-macros-backend",
@ -596,9 +679,9 @@ dependencies = [
[[package]]
name = "pyo3-macros-backend"
version = "0.17.2"
version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f22bb49f6a7348c253d7ac67a6875f2dc65f36c2ae64a82c381d528972bea6d6"
checksum = "dc1f43d8e30460f36350d18631ccf85ded64c059829208fe680904c65bcd0a4c"
dependencies = [
"proc-macro2",
"quote",
@ -736,6 +819,20 @@ dependencies = [
"semver",
]
[[package]]
name = "rustix"
version = "0.36.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd5c6ff11fecd55b40746d1995a02f2eb375bf8c00d192d521ee09f42bef37bc"
dependencies = [
"bitflags",
"errno",
"io-lifetimes",
"libc",
"linux-raw-sys",
"windows-sys",
]
[[package]]
name = "ryu"
version = "1.0.5"
@ -768,7 +865,7 @@ name = "sds-cli"
version = "1.8.6"
dependencies = [
"csv",
"env_logger",
"env_logger 0.9.0",
"log",
"sds-core",
"statrs",
@ -799,7 +896,7 @@ name = "sds-pyo3"
version = "1.8.6"
dependencies = [
"csv",
"env_logger",
"env_logger 0.10.0",
"log",
"pyo3",
"sds-core",
@ -1058,9 +1155,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
[[package]]
name = "version_check"
version = "0.9.3"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
[[package]]
name = "wasi"
@ -1210,3 +1307,69 @@ name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows-sys"
version = "0.45.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-targets"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071"
dependencies = [
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
[[package]]
name = "windows_aarch64_msvc"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
[[package]]
name = "windows_i686_gnu"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
[[package]]
name = "windows_i686_msvc"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
[[package]]
name = "windows_x86_64_gnu"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
[[package]]
name = "windows_x86_64_msvc"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"

Просмотреть файл

@ -423,9 +423,9 @@ fn main() {
reporting_length,
&DpParameters::new(
noise_epsilon.unwrap(),
noise_delta,
sensitivities_percentile.unwrap(),
sensitivities_epsilon_proportion.unwrap(),
noise_delta,
sigma_proportions,
number_of_records_epsilon_proportion,
),

Просмотреть файл

@ -13,12 +13,12 @@ crate-type = ["rlib"]
rand = { version = "0.8" }
fnv = { version = "1.0" }
itertools = { version = "0.10" }
lru = { version = "0.8" }
lru = { version = "0.10" }
getrandom = { version = "0.2", features = ["js"] }
log = { version = "0.4", features = ["std"] }
csv = { version = "1.1" }
instant = { version = "0.1", features = [ "stdweb", "wasm-bindgen" ] }
pyo3 = { version = "0.17", features = ["extension-module"], optional = true }
pyo3 = { version = "0.18", features = ["extension-module"], optional = true }
rayon = { version = "1.5", optional = true }
serde = { version = "1.0", features = [ "derive", "rc" ] }
serde_json = { version = "1.0" }

Просмотреть файл

@ -10,14 +10,14 @@ pub struct DpParameters {
/// Overall privacy budget used between
/// percentile filtering and noisy generation by combination length
pub epsilon: f64,
/// Delta value used for noisy generation by combination length, if None will be set
/// in runtime to `1 / (ln(protected_number_of_records) * protected_number_of_records)`
pub delta: Option<f64>,
/// Percentage used to calculate the percentile that filters sensitivity
pub percentile_percentage: usize,
/// Maximum proportion to consume of the total privacy budget (0.1 means 10%)
/// during the sensitivity filter stage
pub percentile_epsilon_proportion: f64,
/// Delta value used for noisy generation by combination length, if None will be set
/// in runtime to `1 / (ln(protected_number_of_records) * protected_number_of_records)`
pub delta: Option<f64>,
/// `epsilon` and `percentile_epsilon_proportion` will be used to infer the
/// sigma value by combination length. This parameters
/// controls how the budget being split across combination lengths
@ -38,11 +38,11 @@ impl DpParameters {
/// # Arguments
/// * `epsilon` - Overall privacy budget used between
/// percentile filtering and noisy generation by combination length
/// * `delta` - Delta value used for noisy generation by combination length, if None will be set
/// in runtime to `1 / (ln(protected_number_of_records) * protected_number_of_records)`
/// * `percentile_percentage` - Percentage used to calculate the percentile that filters sensitivity
/// * `percentile_epsilon_proportion` - Maximum proportion to consume of the total privacy budget (0.1 means 10%)
/// during the sensitivity filter stage
/// * `delta` - Delta value used for noisy generation by combination length, if None will be set
/// in runtime to `1 / (ln(protected_number_of_records) * protected_number_of_records)`
/// * `sigma_proportions` - `epsilon` and `percentile_epsilon_proportion` will be used to infer the
/// sigma value by combination length. This parameters
/// controls how the budget being split across combination lengths
@ -52,17 +52,17 @@ impl DpParameters {
/// in the aggregated data (if None, no noise is added)
pub fn new(
epsilon: f64,
delta: Option<f64>,
percentile_percentage: usize,
percentile_epsilon_proportion: f64,
delta: Option<f64>,
sigma_proportions: Option<Vec<f64>>,
number_of_records_epsilon_proportion: Option<f64>,
) -> Self {
DpParameters {
epsilon,
delta,
percentile_percentage,
percentile_epsilon_proportion,
delta,
sigma_proportions,
number_of_records_epsilon_proportion,
}
@ -74,11 +74,11 @@ impl DpParameters {
/// # Arguments
/// * `epsilon` - Overall privacy budget used between
/// percentile filtering and noisy generation by combination length
/// * `delta` - Delta value used for noisy generation by combination length, if None will be set
/// in runtime to `1 / (ln(protected_number_of_records) * protected_number_of_records)`
/// * `percentile_percentage` - Percentage used to calculate the percentile that filters sensitivity
/// * `percentile_epsilon_proportion` - Maximum proportion to consume of the total privacy budget (0.1 means 10%)
/// during the sensitivity filter stage
/// * `delta` - Delta value used for noisy generation by combination length, if None will be set
/// in runtime to `1 / (ln(protected_number_of_records) * protected_number_of_records)`
/// * `sigma_proportions` - `epsilon` and `percentile_epsilon_proportion` will be used to infer the
/// sigma value by combination length. This parameters
/// controls how the budget being split across combination lengths
@ -88,17 +88,17 @@ impl DpParameters {
/// in the aggregated data (if None, no noise is added)
pub fn new(
epsilon: f64,
delta: Option<f64>,
percentile_percentage: usize,
percentile_epsilon_proportion: f64,
delta: Option<f64>,
sigma_proportions: Option<Vec<f64>>,
number_of_records_epsilon_proportion: Option<f64>,
) -> Self {
DpParameters {
epsilon,
delta,
percentile_percentage,
percentile_epsilon_proportion,
delta,
sigma_proportions,
number_of_records_epsilon_proportion,
}

Просмотреть файл

@ -23,7 +23,7 @@ fn get_noise_aggregator() -> NoiseAggregator {
0,
),
3,
&DpParameters::new(1.0, Some(0.001), 99, 0.1, None, None),
&DpParameters::new(1.0, 99, 0.1, Some(0.001), None, None),
NoisyCountThreshold::Fixed(InputValueByLen::default()),
)
}

Просмотреть файл

@ -12,7 +12,7 @@ crate-type = ["cdylib"]
[dependencies]
log = { version = "0.4", features = ["std"] }
pyo3 = { version = "0.17", features = ["extension-module", "abi3-py37"] }
pyo3 = { version = "0.18", features = ["extension-module", "abi3-py37"] }
sds-core = { path = "../core", features = ["pyo3", "rayon"] }
serde = { version = "1.0", features = [ "derive", "rc" ] }
serde_json = { version = "1.0" }

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -161,7 +161,7 @@
" <th>count</th>\n",
" <td>6000.000000</td>\n",
" <td>6000.000000</td>\n",
" <td>6000.000000</td>\n",
" <td>6000.00000</td>\n",
" <td>6000.000000</td>\n",
" <td>6000.000000</td>\n",
" <td>6000.000000</td>\n",
@ -172,35 +172,35 @@
" </tr>\n",
" <tr>\n",
" <th>mean</th>\n",
" <td>1.003000</td>\n",
" <td>2.612500</td>\n",
" <td>4.557333</td>\n",
" <td>0.494000</td>\n",
" <td>0.517833</td>\n",
" <td>0.501667</td>\n",
" <td>0.497333</td>\n",
" <td>0.494333</td>\n",
" <td>0.513833</td>\n",
" <td>0.496167</td>\n",
" <td>0.992333</td>\n",
" <td>2.646333</td>\n",
" <td>4.57900</td>\n",
" <td>0.502333</td>\n",
" <td>0.492667</td>\n",
" <td>0.497000</td>\n",
" <td>0.498833</td>\n",
" <td>0.501500</td>\n",
" <td>0.487500</td>\n",
" <td>0.493000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>std</th>\n",
" <td>0.810206</td>\n",
" <td>2.123228</td>\n",
" <td>3.324338</td>\n",
" <td>0.500006</td>\n",
" <td>0.499724</td>\n",
" <td>0.816324</td>\n",
" <td>2.107129</td>\n",
" <td>3.32665</td>\n",
" <td>0.500036</td>\n",
" <td>0.499988</td>\n",
" <td>0.500033</td>\n",
" <td>0.500040</td>\n",
" <td>0.500039</td>\n",
" <td>0.500035</td>\n",
" <td>0.500010</td>\n",
" <td>0.499850</td>\n",
" <td>0.500027</td>\n",
" <td>0.499885</td>\n",
" <td>0.499993</td>\n",
" </tr>\n",
" <tr>\n",
" <th>min</th>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>0.00000</td>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
@ -212,8 +212,8 @@
" <tr>\n",
" <th>25%</th>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>1.000000</td>\n",
" <td>1.00000</td>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
@ -225,21 +225,21 @@
" <tr>\n",
" <th>50%</th>\n",
" <td>1.000000</td>\n",
" <td>2.000000</td>\n",
" <td>4.000000</td>\n",
" <td>0.000000</td>\n",
" <td>1.000000</td>\n",
" <td>3.000000</td>\n",
" <td>5.00000</td>\n",
" <td>1.000000</td>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>1.000000</td>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75%</th>\n",
" <td>2.000000</td>\n",
" <td>5.000000</td>\n",
" <td>7.000000</td>\n",
" <td>7.00000</td>\n",
" <td>1.000000</td>\n",
" <td>1.000000</td>\n",
" <td>1.000000</td>\n",
@ -252,7 +252,7 @@
" <th>max</th>\n",
" <td>2.000000</td>\n",
" <td>6.000000</td>\n",
" <td>10.000000</td>\n",
" <td>10.00000</td>\n",
" <td>1.000000</td>\n",
" <td>1.000000</td>\n",
" <td>1.000000</td>\n",
@ -266,23 +266,23 @@
"</div>"
],
"text/plain": [
" H1 H2 H3 H4 H5 \\\n",
"count 6000.000000 6000.000000 6000.000000 6000.000000 6000.000000 \n",
"mean 1.003000 2.612500 4.557333 0.494000 0.517833 \n",
"std 0.810206 2.123228 3.324338 0.500006 0.499724 \n",
"min 0.000000 0.000000 0.000000 0.000000 0.000000 \n",
"25% 0.000000 0.000000 1.000000 0.000000 0.000000 \n",
"50% 1.000000 2.000000 4.000000 0.000000 1.000000 \n",
"75% 2.000000 5.000000 7.000000 1.000000 1.000000 \n",
"max 2.000000 6.000000 10.000000 1.000000 1.000000 \n",
" H1 H2 H3 H4 H5 \\\n",
"count 6000.000000 6000.000000 6000.00000 6000.000000 6000.000000 \n",
"mean 0.992333 2.646333 4.57900 0.502333 0.492667 \n",
"std 0.816324 2.107129 3.32665 0.500036 0.499988 \n",
"min 0.000000 0.000000 0.00000 0.000000 0.000000 \n",
"25% 0.000000 1.000000 1.00000 0.000000 0.000000 \n",
"50% 1.000000 3.000000 5.00000 1.000000 0.000000 \n",
"75% 2.000000 5.000000 7.00000 1.000000 1.000000 \n",
"max 2.000000 6.000000 10.00000 1.000000 1.000000 \n",
"\n",
" H6 H7 H8 H9 H10 \n",
"count 6000.000000 6000.000000 6000.000000 6000.000000 6000.000000 \n",
"mean 0.501667 0.497333 0.494333 0.513833 0.496167 \n",
"std 0.500039 0.500035 0.500010 0.499850 0.500027 \n",
"mean 0.497000 0.498833 0.501500 0.487500 0.493000 \n",
"std 0.500033 0.500040 0.500039 0.499885 0.499993 \n",
"min 0.000000 0.000000 0.000000 0.000000 0.000000 \n",
"25% 0.000000 0.000000 0.000000 0.000000 0.000000 \n",
"50% 1.000000 0.000000 0.000000 1.000000 0.000000 \n",
"50% 0.000000 0.000000 1.000000 0.000000 0.000000 \n",
"75% 1.000000 1.000000 1.000000 1.000000 1.000000 \n",
"max 1.000000 1.000000 1.000000 1.000000 1.000000 "
]
@ -337,42 +337,42 @@
" <tbody>\n",
" <tr>\n",
" <th>count</th>\n",
" <td>6001.000000</td>\n",
" <td>6001.000000</td>\n",
" <td>6001.000000</td>\n",
" <td>6001.000000</td>\n",
" <td>6001.000000</td>\n",
" <td>6001.000000</td>\n",
" <td>6001.000000</td>\n",
" <td>6001.000000</td>\n",
" <td>6001.000000</td>\n",
" <td>6001.000000</td>\n",
" <td>6030.000000</td>\n",
" <td>6030.000000</td>\n",
" <td>6030.000000</td>\n",
" <td>6030.000000</td>\n",
" <td>6030.000000</td>\n",
" <td>6030.000000</td>\n",
" <td>6030.000000</td>\n",
" <td>6030.000000</td>\n",
" <td>6030.000000</td>\n",
" <td>6030.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>mean</th>\n",
" <td>0.976671</td>\n",
" <td>2.495084</td>\n",
" <td>4.334778</td>\n",
" <td>0.453091</td>\n",
" <td>0.478587</td>\n",
" <td>0.457424</td>\n",
" <td>0.461256</td>\n",
" <td>0.462923</td>\n",
" <td>0.473254</td>\n",
" <td>0.465756</td>\n",
" <td>0.937977</td>\n",
" <td>2.462023</td>\n",
" <td>4.250083</td>\n",
" <td>0.477944</td>\n",
" <td>0.470149</td>\n",
" <td>0.462355</td>\n",
" <td>0.478441</td>\n",
" <td>0.475788</td>\n",
" <td>0.465008</td>\n",
" <td>0.469818</td>\n",
" </tr>\n",
" <tr>\n",
" <th>std</th>\n",
" <td>0.815346</td>\n",
" <td>2.140020</td>\n",
" <td>3.378620</td>\n",
" <td>0.497836</td>\n",
" <td>0.499583</td>\n",
" <td>0.498225</td>\n",
" <td>0.498538</td>\n",
" <td>0.498665</td>\n",
" <td>0.499326</td>\n",
" <td>0.498868</td>\n",
" <td>0.825132</td>\n",
" <td>2.132173</td>\n",
" <td>3.401991</td>\n",
" <td>0.499555</td>\n",
" <td>0.499150</td>\n",
" <td>0.498622</td>\n",
" <td>0.499576</td>\n",
" <td>0.499455</td>\n",
" <td>0.498815</td>\n",
" <td>0.499130</td>\n",
" </tr>\n",
" <tr>\n",
" <th>min</th>\n",
@ -445,9 +445,9 @@
],
"text/plain": [
" H1 H2 H3 H4 H5 \\\n",
"count 6001.000000 6001.000000 6001.000000 6001.000000 6001.000000 \n",
"mean 0.976671 2.495084 4.334778 0.453091 0.478587 \n",
"std 0.815346 2.140020 3.378620 0.497836 0.499583 \n",
"count 6030.000000 6030.000000 6030.000000 6030.000000 6030.000000 \n",
"mean 0.937977 2.462023 4.250083 0.477944 0.470149 \n",
"std 0.825132 2.132173 3.401991 0.499555 0.499150 \n",
"min 0.000000 0.000000 0.000000 0.000000 0.000000 \n",
"25% 0.000000 0.000000 1.000000 0.000000 0.000000 \n",
"50% 1.000000 2.000000 4.000000 0.000000 0.000000 \n",
@ -455,9 +455,9 @@
"max 2.000000 6.000000 10.000000 1.000000 1.000000 \n",
"\n",
" H6 H7 H8 H9 H10 \n",
"count 6001.000000 6001.000000 6001.000000 6001.000000 6001.000000 \n",
"mean 0.457424 0.461256 0.462923 0.473254 0.465756 \n",
"std 0.498225 0.498538 0.498665 0.499326 0.498868 \n",
"count 6030.000000 6030.000000 6030.000000 6030.000000 6030.000000 \n",
"mean 0.462355 0.478441 0.475788 0.465008 0.469818 \n",
"std 0.498622 0.499576 0.499455 0.498815 0.499130 \n",
"min 0.000000 0.000000 0.000000 0.000000 0.000000 \n",
"25% 0.000000 0.000000 0.000000 0.000000 0.000000 \n",
"50% 0.000000 0.000000 0.000000 0.000000 0.000000 \n",
@ -491,7 +491,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.4"
"version": "3.10.6"
},
"orig_nbformat": 4,
"vscode": {

Просмотреть файл

@ -71,9 +71,9 @@ impl DpAggregateSeededSynthesizer {
self._parameters.reporting_length,
&DpParameters::new(
self._parameters.epsilon,
self._parameters.delta,
self._parameters.percentile_percentage,
self._parameters.percentile_epsilon_proportion,
self._parameters.delta,
Some(self._parameters.sigma_proportions.clone()),
Some(self._parameters.number_of_records_epsilon_proportion),
),

Просмотреть файл

@ -13,6 +13,6 @@ crate-type = ["cdylib"]
[dependencies]
log = { version = "0.4", features = ["std"] }
csv = { version = "1.1" }
pyo3 = { version = "0.17", features = ["extension-module"] }
pyo3 = { version = "0.18", features = ["extension-module"] }
sds-core = { path = "../core", features = ["pyo3", "rayon"] }
env_logger = { version = "0.9" }
env_logger = { version = "0.10" }

Просмотреть файл

@ -48,11 +48,11 @@ impl SDSProcessor {
pub fn new(
path: &str,
delimiter: char,
subject_id: Option<String>,
use_columns: Vec<String>,
multi_value_columns: HashMap<String, String>,
sensitive_zeros: Vec<String>,
record_limit: usize,
subject_id: Option<String>,
) -> Result<SDSProcessor, CsvDataBlockCreatorError> {
CsvDataBlockCreator::create(
ReaderBuilder::new()

Просмотреть файл

@ -46,11 +46,11 @@ export interface INoisyCountThreshold {
export interface IDpParameters {
epsilon: number
delta: number
percentilePercentage: number
percentileEpsilonProportion: number
numberOfRecordsEpsilonProportion?: number
delta?: number
sigmaProportions?: number[]
numberOfRecordsEpsilonProportion?: number
}
export interface IOversamplingParameters {

Просмотреть файл

@ -53,11 +53,11 @@ def aggregate(config):
sds_processor = sds.SDSProcessor(
sensitive_microdata_path,
sensitive_microdata_delimiter,
subject_id,
use_columns,
multi_value_columns,
sensitive_zeros,
max(record_limit, 0)
max(record_limit, 0),
subject_id
)
aggregated_data = sds_processor.aggregate(
@ -86,9 +86,9 @@ def aggregate(config):
reporting_length,
sds.DpParameters(
noise_epsilon,
noise_delta,
percentile_percentage,
percentile_epsilon_proportion,
noise_delta,
sigma_proportions,
number_of_records_epsilon_proportion
),
@ -99,9 +99,9 @@ def aggregate(config):
reporting_length,
sds.DpParameters(
noise_epsilon,
noise_delta,
percentile_percentage,
percentile_epsilon_proportion,
noise_delta,
sigma_proportions,
number_of_records_epsilon_proportion
),

Просмотреть файл

@ -84,11 +84,11 @@ class Evaluator:
self.syn_sds_processor = sds.SDSProcessor(
self.synthetic_microdata_path,
"\t",
None, # the synthetic data does not have an ID
[], # use all columns from synthetic file
[], # use all columns from synthetic file
self.multi_value_columns,
self.sensitive_zeros,
0 # use all records from synthetic file
0, # use all records from synthetic file
None # the synthetic data does not have an ID
)
self.syn_aggregated_data = self.syn_sds_processor.aggregate(
self.reporting_length

Просмотреть файл

@ -46,11 +46,11 @@ def generate(config):
sds_processor = sds.SDSProcessor(
sensitive_microdata_path,
sensitive_microdata_delimiter,
subject_id,
use_columns,
multi_value_columns,
sensitive_zeros,
max(record_limit, 0)
max(record_limit, 0),
subject_id
)
if synthesis_mode == 'unseeded':

Просмотреть файл

@ -186,15 +186,15 @@ function convertRawToSynthesisParameters(
...ret,
dpParameters: {
epsilon: rawParams.noiseEpsilon,
delta: noiseDelta,
percentilePercentage: rawParams.percentilePercentage,
percentileEpsilonProportion: rawParams.percentileEpsilonProportion,
numberOfRecordsEpsilonProportion:
rawParams.numberOfRecordsEpsilonProportion,
delta: noiseDelta,
sigmaProportions: generateSigmaProportions(
rawParams.reportingLength,
rawParams.accuracyMode,
),
numberOfRecordsEpsilonProportion:
rawParams.numberOfRecordsEpsilonProportion,
},
noiseThreshold: {
type: 'Adaptive',