pub struct MetricSpec {Show 13 fields
pub schema_version: u32,
pub metric_id: String,
pub kind: SemanticSpecKind,
pub task_kinds: BTreeSet<LearningTaskKind>,
pub prediction_kinds: BTreeSet<PredictionKind>,
pub objective: MetricObjective,
pub supported_levels: BTreeSet<PredictionLevel>,
pub decomposition: MetricDecomposition,
pub reduction: MetricReduction,
pub required_inputs: BTreeSet<CriterionInput>,
pub capabilities: BTreeSet<MetricCapability>,
pub parameters: Value,
pub spec_fingerprint: String,
}Fields§
§schema_version: u32§metric_id: String§kind: SemanticSpecKind§task_kinds: BTreeSet<LearningTaskKind>§prediction_kinds: BTreeSet<PredictionKind>§objective: MetricObjective§supported_levels: BTreeSet<PredictionLevel>§decomposition: MetricDecomposition§reduction: MetricReduction§required_inputs: BTreeSet<CriterionInput>§capabilities: BTreeSet<MetricCapability>§parameters: Value§spec_fingerprint: StringImplementations§
Source§impl MetricSpec
impl MetricSpec
pub fn new( metric_id: impl Into<String>, kind: SemanticSpecKind, task_kinds: BTreeSet<LearningTaskKind>, prediction_kinds: BTreeSet<PredictionKind>, objective: MetricObjective, supported_levels: BTreeSet<PredictionLevel>, decomposition: MetricDecomposition, reduction: MetricReduction, required_inputs: BTreeSet<CriterionInput>, capabilities: BTreeSet<MetricCapability>, parameters: Value, ) -> Result<MetricSpec, DagMlError>
pub fn from_json(json: &str) -> Result<MetricSpec, DagMlError>
pub fn compute_fingerprint(&self) -> Result<String, DagMlError>
pub fn validate(&self) -> Result<(), DagMlError>
pub fn validate_compatibility( &self, task_kind: LearningTaskKind, prediction_kind: PredictionKind, level: PredictionLevel, ) -> Result<(), DagMlError>
Trait Implementations§
Source§impl Clone for MetricSpec
impl Clone for MetricSpec
Source§fn clone(&self) -> MetricSpec
fn clone(&self) -> MetricSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MetricSpec
impl Debug for MetricSpec
Source§impl<'de> Deserialize<'de> for MetricSpec
impl<'de> Deserialize<'de> for MetricSpec
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MetricSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MetricSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for MetricSpec
Source§impl PartialEq for MetricSpec
impl PartialEq for MetricSpec
Source§impl Serialize for MetricSpec
impl Serialize for MetricSpec
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for MetricSpec
Auto Trait Implementations§
impl Freeze for MetricSpec
impl RefUnwindSafe for MetricSpec
impl Send for MetricSpec
impl Sync for MetricSpec
impl Unpin for MetricSpec
impl UnsafeUnpin for MetricSpec
impl UnwindSafe for MetricSpec
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.