@@ -592,11 +592,17 @@ unsigned long ADOutlierCOPOD::compute_outliers(Anomalies &outliers,
592592 std::vector<double > recon_p_runtimes = std::vector<double >(tot_runtimes, 0.0 );
593593 std::vector<double > recon_n_runtimes = std::vector<double >(tot_runtimes, 0.0 );
594594 int recon_idx = 0 ;
595+ // verboseStream << "Unwrapping Merged Histogram. Size: " << param[func_id].counts().size() << std::endl;
595596 for (int i=0 ; i < param[func_id].counts ().size (); i++){
596597 int count = param[func_id].counts ().at (i);
598+ // verboseStream << "Count: " << count << ", Value: " << param[func_id].bin_edges().at(i) << std::endl;
597599 for (int j=0 ; j<count; j++){
598- recon_p_runtimes.at (recon_idx++) = param[func_id].bin_edges ().at (i);
599- recon_n_runtimes.at (recon_idx++) = -1 * param[func_id].bin_edges ().at (i);
600+
601+ recon_p_runtimes.at (recon_idx) = param[func_id].bin_edges ().at (i);
602+ recon_n_runtimes.at (recon_idx) = -1 * param[func_id].bin_edges ().at (i);
603+ // verboseStream << "recon_p_runtimes.at(recon_idx): " << recon_p_runtimes.at(recon_idx) << ", recon_n_runtimes.at(recon_idx): " << recon_n_runtimes.at(recon_idx) << std::endl;
604+ // verboseStream << "recon_idx: " << recon_idx << std::endl;
605+ recon_idx++;
600606 }
601607 }
602608
@@ -664,8 +670,9 @@ unsigned long ADOutlierCOPOD::compute_outliers(Anomalies &outliers,
664670
665671 const double runtime_i = this ->getStatisticValue (*itt); // runtimes.push_back(this->getStatisticValue(*itt));
666672 double ad_score;
667-
668- if (mean_pn_ecdf.at (running_idx++) > 0 )
673+
674+ // verboseStream << "mean_pn_ecdf.at(running_idx++): " << mean_pn_ecdf.at(running_idx) << std::endl;
675+ if (mean_pn_ecdf.at (running_idx++) < 0.99 )
669676 ad_score = l_threshold + 1 ;
670677 else
671678 ad_score = l_threshold - 1 ;
@@ -686,8 +693,8 @@ unsigned long ADOutlierCOPOD::compute_outliers(Anomalies &outliers,
686693 // Capture maximum of one normal execution per io step
687694 itt->set_label (1 );
688695 if (outliers.nFuncEvents (func_id, Anomalies::EventType::Normal) == 0 ) {
689- verboseStream << " Detected normal event on func id " << func_id << " (" << itt->get_funcname () << " ) on thread " << itt->get_tid () << " runtime " << runtime_i << std::endl;
690- outliers.insert (itt, Anomalies::EventType::Normal);
696+ verboseStream << " Detected normal event on func id " << func_id << " (" << itt->get_funcname () << " ) on thread " << itt->get_tid () << " runtime " << runtime_i << std::endl;
697+ outliers.insert (itt, Anomalies::EventType::Normal);
691698 }
692699
693700 }
@@ -720,9 +727,9 @@ int ADOutlierCOPOD::np_digitize_get_bin_inds(const double& X, const std::vector<
720727}
721728
722729std::vector<double > ADOutlierCOPOD::empiricalCDF (const std::vector<double >& runtimes, const bool sorted) {
723-
724- std::vector<double > tmp_runtimes = runtimes;
725- auto ecdf = boost::math::empirical_cumulative_distribution_function (std::move (tmp_runtimes));
730+
731+ std::vector<double > tmp_runtimes = runtimes;
732+ auto ecdf = boost::math::empirical_cumulative_distribution_function (std::move (tmp_runtimes));
726733 std::vector<double > result_ecdf = std::vector<double >(runtimes.size (), 0.0 );
727734 for (int i=0 ; i < runtimes.size (); i++) {
728735 result_ecdf.at (i) = ecdf (runtimes.at (i));
0 commit comments