#![allow(unused)]
#![cfg_attr(coverage_nightly, coverage(off))]
use super::types::{
AnomalyPoint, CodeCommunity, Finding, FindingCluster, MetricTrend, TrendDirection,
};
use aprender::prelude::*;
use std::collections::HashMap;
use std::path::PathBuf;
pub struct DataScienceAnalyzer {
k_clusters: usize,
pagerank_damping: f64,
louvain_resolution: f64,
anomaly_threshold: f64,
}
impl Default for DataScienceAnalyzer {
fn default() -> Self {
DataScienceAnalyzer {
k_clusters: 4,
pagerank_damping: 0.85,
louvain_resolution: 1.0,
anomaly_threshold: 0.7,
}
}
}
impl DataScienceAnalyzer {
#[provable_contracts_macros::contract("pmat-core.yaml", equation = "check_compliance")]
pub fn new(
k_clusters: usize,
pagerank_damping: f64,
louvain_resolution: f64,
anomaly_threshold: f64,
) -> Self {
DataScienceAnalyzer {
k_clusters,
pagerank_damping,
louvain_resolution,
anomaly_threshold,
}
}
}
include!("data_science_clustering.rs");
include!("data_science_graph.rs");
include!("data_science_anomaly.rs");
include!("data_science_trends.rs");
#[cfg_attr(coverage_nightly, coverage(off))]
#[cfg(test)]
mod tests {
include!("data_science_tests.rs");
}