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

Function corr_to_distance

crates/openquant/src/onc.rs:316–326  ·  view source on GitHub ↗
(corr: &DMatrix<f64>)

Source from the content-addressed store, hash-verified

314
315 let new_tstat_mean = {
316 let mut vals = Vec::new();
317 for members in improved.clusters.values() {
318 let scores: Vec<f64> =
319 members.iter().map(|&idx| improved.silhouette_scores[idx]).collect();
320 vals.push(tstat(&scores));
321 }
322 vals.iter().sum::<f64>() / vals.len() as f64
323 };
324
325 Ok(check_improve_clusters(new_tstat_mean, mean_redo_tstat, base, improved))
326}
327
328fn improve_clusters(
329 corr_mat: &DMatrix<f64>,

Callers 2

improve_clustersFunction · 0.85
cluster_kmeans_baseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected