Function smartnoise_runtime::components::impute::impute_float_gaussian_arrayd[][src]

pub fn impute_float_gaussian_arrayd(
    data: ArrayD<Float>,
    lower: ArrayD<Float>,
    upper: ArrayD<Float>,
    shift: ArrayD<Float>,
    scale: ArrayD<Float>,
    enforce_constant_time: bool
) -> Result<ArrayD<Float>>

Returns data with imputed values in place of f64::NAN. Values are imputed from a truncated Gaussian distribution.

Arguments

Return

Data with NAN values replaced with imputed values.

Example

use ndarray::prelude::*;
use smartnoise_runtime::components::impute::impute_float_gaussian_arrayd;
use smartnoise_validator::Float;
let data: ArrayD<Float> = arr1(&[1., Float::NAN, 3., Float::NAN]).into_dyn();
let lower: ArrayD<Float> = arr1(&[0.0]).into_dyn();
let upper: ArrayD<Float> = arr1(&[10.0]).into_dyn();
let shift: ArrayD<Float> = arr1(&[5.0]).into_dyn();
let scale: ArrayD<Float> = arr1(&[7.0]).into_dyn();
let imputed = impute_float_gaussian_arrayd(data, lower, upper, shift, scale, false);