pub struct LabeledSample {
pub sample: TrainingSample,
pub source: DataSource,
pub label_confidence: f64,
pub c_code: String,
pub rust_code: String,
pub metadata: HashMap<String, String>,
}Expand description
A labeled training sample with provenance metadata.
Fields§
§sample: TrainingSampleCore training sample (features + label).
source: DataSourceWhere this sample came from.
label_confidence: f64Confidence in the label (0.0 - 1.0).
c_code: StringOriginal C code snippet.
rust_code: StringExpected Rust code snippet.
metadata: HashMap<String, String>Additional metadata.
Implementations§
Source§impl LabeledSample
impl LabeledSample
Sourcepub fn new(
sample: TrainingSample,
source: DataSource,
c_code: &str,
rust_code: &str,
) -> Self
pub fn new( sample: TrainingSample, source: DataSource, c_code: &str, rust_code: &str, ) -> Self
Create a new labeled sample.
Sourcepub fn with_confidence(self, confidence: f64) -> Self
pub fn with_confidence(self, confidence: f64) -> Self
Set label confidence.
Sourcepub fn with_metadata(self, key: &str, value: &str) -> Self
pub fn with_metadata(self, key: &str, value: &str) -> Self
Add metadata.
Trait Implementations§
Source§impl Clone for LabeledSample
impl Clone for LabeledSample
Source§fn clone(&self) -> LabeledSample
fn clone(&self) -> LabeledSample
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 moreAuto Trait Implementations§
impl Freeze for LabeledSample
impl RefUnwindSafe for LabeledSample
impl Send for LabeledSample
impl Sync for LabeledSample
impl Unpin for LabeledSample
impl UnwindSafe for LabeledSample
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