pub struct CommitFeatures {
pub lines_added: u32,
pub lines_deleted: u32,
pub files_changed: u32,
pub churn_ratio: f32,
pub has_test_changes: bool,
pub complexity_delta: f32,
pub author_experience: f32,
pub days_since_last_change: f32,
}Expand description
8-dimensional feature vector for commit-level defect prediction
Fields§
§lines_added: u32Total lines added in the commit
lines_deleted: u32Total lines deleted in the commit
files_changed: u32Number of files changed
churn_ratio: f32Churn ratio: added / (added + deleted + 1)
has_test_changes: boolWhether any test files were modified
complexity_delta: f32Estimated cyclomatic complexity change
Author’s normalized experience (0.0 = new, 1.0 = experienced)
days_since_last_change: f32Days since last change to affected files
Implementations§
Source§impl CommitFeatures
impl CommitFeatures
Sourcepub fn from_array(arr: [f32; 8]) -> Self
pub fn from_array(arr: [f32; 8]) -> Self
Create from a feature array
Sourcepub fn normalize(&self, stats: &FeatureStats) -> [f32; 8]
pub fn normalize(&self, stats: &FeatureStats) -> [f32; 8]
Normalize features for ML models
Uses the provided statistics to z-score normalize numeric features.
Trait Implementations§
Source§impl Clone for CommitFeatures
impl Clone for CommitFeatures
Source§fn clone(&self) -> CommitFeatures
fn clone(&self) -> CommitFeatures
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 CommitFeatures
impl Debug for CommitFeatures
Source§impl Default for CommitFeatures
impl Default for CommitFeatures
Source§fn default() -> CommitFeatures
fn default() -> CommitFeatures
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CommitFeatures
impl<'de> Deserialize<'de> for CommitFeatures
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 PartialEq for CommitFeatures
impl PartialEq for CommitFeatures
Source§impl Serialize for CommitFeatures
impl Serialize for CommitFeatures
impl StructuralPartialEq for CommitFeatures
Auto Trait Implementations§
impl Freeze for CommitFeatures
impl RefUnwindSafe for CommitFeatures
impl Send for CommitFeatures
impl Sync for CommitFeatures
impl Unpin for CommitFeatures
impl UnsafeUnpin for CommitFeatures
impl UnwindSafe for CommitFeatures
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more