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

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

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

Arguments

Return

Data with NAN values replaced with imputed values.

Example

use ndarray::prelude::*;
use smartnoise_runtime::components::impute::impute_float_uniform_arrayd;
use smartnoise_validator::Float;

let data: ArrayD<Float> = arr2(&[ [1., Float::NAN, 3., Float::NAN], [2., 2., Float::NAN, Float::NAN] ]).into_dyn();
let lower: ArrayD<Float> = arr1(&[0., 2., 3., 4.]).into_dyn();
let upper: ArrayD<Float> = arr1(&[10., 2., 5., 5.]).into_dyn();
let imputed = impute_float_uniform_arrayd(data, lower, upper, false);