Skip to main content

apply_mask

Function apply_mask 

Source
pub fn apply_mask(data: &mut Array2<f64>, mask: &Array2<u8>) -> Result<()>
Expand description

Apply a missingness mask, replacing imputed values with NaN.

mask[t, c] == 1 signals that the value at (t, c) was imputed (not observed). This function sets those positions to NaN so they are excluded from mean / statistics computations in the captioning pipeline.

Both arrays must have the same shape.