Skip to main content

fit_transform

Function fit_transform 

Source
pub fn fit_transform(
    data: &[f32],
    n: usize,
    d: usize,
    config: PaCMAPConfig,
    progress: Option<Sender<PaCMAPProgress>>,
    cancel: Option<Arc<AtomicBool>>,
) -> Result<Vec<[f32; 2]>, PaCMAPError>
Expand description

Embed n × d row-major f32 data into 2 dimensions.

§Arguments

  • data: flat row-major slice, len = n * d
  • n: number of points; must be ≥ 2 and ≤ u32::MAX
  • d: number of dimensions per point; must be ≥ 1
  • config: algorithm configuration
  • progress: optional channel for per-iteration progress events
  • cancel: optional cancellation token; checked once per iteration

§Returns

n [f32; 2] pairs aligned with the input rows, or a PaCMAPError.