MCPcopy Create free account
hub / github.com/Open-Quant/openquant / rank_desc

Function rank_desc

crates/openquant/src/feature_importance.rs:437–445  ·  view source on GitHub ↗
(values: &[f64])

Source from the content-addressed store, hash-verified

435 let n = rows.len();
436 let m = rows[0].len();
437 let flat: Vec<f64> = rows.iter().flat_map(|r| r.iter().copied()).collect();
438 DMatrix::<f64>::from_row_slice(n, m, &flat)
439}
440
441fn pearson_corr(x: &[f64], y: &[f64]) -> f64 {
442 if x.len() != y.len() || x.is_empty() {
443 return 0.0;
444 }
445 let mx = x.iter().sum::<f64>() / x.len() as f64;
446 let my = y.iter().sum::<f64>() / y.len() as f64;
447 let mut num = 0.0;
448 let mut vx = 0.0;

Callers 2

feature_pca_analysisFunction · 0.85
spearman_corrFunction · 0.85

Calls 1

lenMethod · 0.80

Tested by

no test coverage detected