apply_transform

Function apply_transform 

Source
pub fn apply_transform<T>(data: &[T], transform_type: TransformType) -> Vec<f64>
where T: Num + NumCast + Copy,
Expand description

Applies a specified transformation to a numeric data series.

See crate::transforms::TransformType for information on the supported transformations.

ยงExample

use quant_mathema::transforms::{apply_transform, TransformType};

let data = vec![0.0, 1.0, 4.0, 9.0, 16.0];
let data_sqrt_trans = apply_transform(&data, TransformType::Sqrt);
let data_log_trans = apply_transform(&data, TransformType::Log);
let data_tanh_trans = apply_transform(&data, TransformType::Tanh);