pub struct ReputationScore {
pub score: f64,
pub confidence: f64,
pub level: ConfidenceLevel,
pub components: ScoreComponents,
pub is_provisional: bool,
pub data_points: u32,
pub algorithm_version: String,
pub calculated_at: DateTime<Utc>,
}Expand description
The calculated reputation score for an agent
Contains the final reputation score along with detailed metadata about how it was calculated, component breakdowns, and confidence level.
§Fields
score: The final reputation score (0-100)confidence: How confident we are in the score (0-1)level: Categorized confidence level (Low/Medium/High)components: Detailed breakdown of score componentsis_provisional: Whether score is provisional (confidence < 0.2)data_points: Total data points used (interactions + reviews)algorithm_version: Version of algorithm usedcalculated_at: When the score was calculated
§Interpretation
§Score Ranges
- 0-20: Very poor reputation
- 20-40: Poor reputation
- 40-60: Average reputation
- 60-80: Good reputation
- 80-100: Excellent reputation
§Confidence Levels
- Low (0-0.2): Limited data, provisional score
- Medium (0.2-0.7): Moderate confidence
- High (0.7-1.0): High confidence, substantial data
§Example
use reputation_types::{ReputationScore, ConfidenceLevel, ScoreComponents, PriorBreakdown};
use chrono::Utc;
let score = ReputationScore {
score: 75.5,
confidence: 0.85,
level: ConfidenceLevel::High,
components,
is_provisional: false,
data_points: 150,
algorithm_version: "1.0.0".to_string(),
calculated_at: Utc::now(),
};
if score.is_provisional {
println!("Provisional score: {:.1} (needs more data)", score.score);
} else {
println!("{:?} confidence score: {:.1}", score.level, score.score);
}Fields§
§score: f64The final reputation score (0-100 scale)
confidence: f64Confidence in the score based on data availability (0-1)
level: ConfidenceLevelCategorized confidence level
components: ScoreComponentsDetailed breakdown of score components
is_provisional: boolWhether this is a provisional score (confidence < 0.2)
data_points: u32Total data points used in calculation
algorithm_version: StringVersion of the algorithm used for calculation
calculated_at: DateTime<Utc>Timestamp when the score was calculated
Trait Implementations§
Source§impl Clone for ReputationScore
impl Clone for ReputationScore
Source§fn clone(&self) -> ReputationScore
fn clone(&self) -> ReputationScore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReputationScore
impl Debug for ReputationScore
Source§impl<'de> Deserialize<'de> for ReputationScore
impl<'de> Deserialize<'de> for ReputationScore
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ReputationScore
impl Display for ReputationScore
Auto Trait Implementations§
impl Freeze for ReputationScore
impl RefUnwindSafe for ReputationScore
impl Send for ReputationScore
impl Sync for ReputationScore
impl Unpin for ReputationScore
impl UnwindSafe for ReputationScore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more