pub struct GraphFeatures {
pub node_count: f64,
pub edge_count: f64,
pub avg_degree: f64,
pub max_degree: f64,
pub min_degree: f64,
pub density: f64,
pub component_count: f64,
}Expand description
Cheap-to-extract graph statistics used as input features for the EML coherence model.
Fields§
§node_count: f64Number of nodes |V|.
edge_count: f64Number of edges |E|.
avg_degree: f64Average degree: 2*|E| / |V| (undirected interpretation).
max_degree: f64Maximum degree across all nodes.
min_degree: f64Minimum degree across all nodes.
density: f64Edge density: 2*|E| / (|V| * (|V|-1)).
component_count: f64Number of connected components.
Implementations§
Source§impl GraphFeatures
impl GraphFeatures
Sourcepub fn from_causal_graph(graph: &CausalGraph) -> Self
pub fn from_causal_graph(graph: &CausalGraph) -> Self
Extract features from a CausalGraph in O(n) time.
Trait Implementations§
Source§impl Clone for GraphFeatures
impl Clone for GraphFeatures
Source§impl Debug for GraphFeatures
impl Debug for GraphFeatures
Source§impl<'de> Deserialize<'de> for GraphFeatures
impl<'de> Deserialize<'de> for GraphFeatures
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 FeatureVector for GraphFeatures
impl FeatureVector for GraphFeatures
Auto Trait Implementations§
impl Freeze for GraphFeatures
impl RefUnwindSafe for GraphFeatures
impl Send for GraphFeatures
impl Sync for GraphFeatures
impl Unpin for GraphFeatures
impl UnsafeUnpin for GraphFeatures
impl UnwindSafe for GraphFeatures
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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