about summary refs log tree commit diff
path: root/src/correlations.rs
diff options
context:
space:
mode:
authorAlexander_Kabui <alexanderkabua@gmail.com>2022-07-14 13:18:28 +0300
committerAlexander_Kabui <alexanderkabua@gmail.com>2022-07-14 13:18:28 +0300
commit201a9da4fef5f8a668776a7ec997ac2f0f11e868 (patch)
treed3221dc8413b0aa7261efcb03de0c9489b5bac51 /src/correlations.rs
parent9405abf4fa18b4263c49af67bfcdf176bcf2aeed (diff)
downloadcorrelation_rust-201a9da4fef5f8a668776a7ec997ac2f0f11e868.tar.gz
add numoverlap to output
Diffstat (limited to 'src/correlations.rs')
-rw-r--r--src/correlations.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/correlations.rs b/src/correlations.rs
index fcc8d29..88249c0 100644
--- a/src/correlations.rs
+++ b/src/correlations.rs
@@ -137,7 +137,7 @@ impl<'a> Compute<'a> {
     pub fn compute(&self) -> Vec<(String, f64, f64)> {
         //read from file);
 
-        let mut corr_results: Vec<(String, f64, f64)> = Vec::new();
+        let mut corr_results: Vec<(String, f64, f64,i32)> = Vec::new();
 
         let reader = BufferReader::new(self.dataset_path);
 
@@ -185,14 +185,14 @@ impl<'a> Compute<'a> {
                             let (rho, p_val) = Pearson::new(parsed_x_val.len())
                                 .correlate(&parsed_x_val, &parsed_y_val);
 
-                            corr_results.push((key_name, rho, p_val));
+                            corr_results.push((key_name, rho, p_val,parsed_x_val.len()  as i32));
 
                             //writeln!(file, "{},{},{}",key_name,rho,p_val);
                         } else {
                             let (rho, p_val) = Spearman::new(parsed_x_val.len())
                                 .correlate(&parsed_x_val, &parsed_y_val);
 
-                            corr_results.push((key_name, rho, p_val));
+                            corr_results.push((key_name, rho, p_val,parsed_x_val.len() as i32));
 
                             //writeln!(file, "{},{},{}", key_name,rho,p_val);
                         }