Function smartnoise_runtime::components::resize::resize_float [−][src]
pub fn resize_float(
data: ArrayD<Float>,
resize_config: RowResizeConfig,
number_cols: Option<i64>,
distribution: &str,
lower: ArrayD<Float>,
upper: ArrayD<Float>,
shift: Option<ArrayD<Float>>,
scale: Option<ArrayD<Float>>,
privacy_definition: &Option<PrivacyDefinition>
) -> Result<ArrayD<Float>>
Resizes data (made up exclusively of f64) based on estimate of n and true size of data.
Notice that some arguments are denoted with Option<> – this is because not every distribution used for imputation (if necessary) uses every argument (e.g. Uniform does not use shift or scale).
NOTE: If more distributions are added here, their corresponding arguments must be added as inputs.
Arguments
data
- The data to be resizedn
- An estimate of the size of the data – this could be the guess of the user, or the result of a DP releasedistribution
- The distribution to be used when imputing recordslower
- A lower bound on data elementsupper
- An upper bound on data elementsshift
- The shift (expectation) argument for the Gaussian distributionscale
- The scale (standard deviation) argument for the Gaussian distributionminimum_rows
- The minimum number of rows in the output dataset. Same as number_rows, but will not sample down.p
- Maximum proportion of dataset included in output
Return
A resized version of data consistent with the provided n