pub enum LinkPredictionMetric {
CommonNeighbors,
Jaccard,
AdamicAdar,
ResourceAllocation,
PreferentialAttachment,
}Expand description
Which score Graph::link_prediction_score computes for a pair of nodes.
All five read the graph as undirected over distinct neighbors, the same
neighborhood Graph::clustering_coefficient uses, so a pair joined by several
edges is one neighbor and direction never matters. A higher score means the pair
is more likely to become connected.
Variants§
CommonNeighbors
How many neighbors the two nodes share.
Jaccard
Shared neighbors over the size of the combined neighborhood, so a pair of low-degree nodes is not penalized against a pair of hubs. Zero when neither node has a neighbor.
AdamicAdar
Shared neighbors weighted by 1 / ln(degree), so a neighbor that everyone
shares counts for little. A shared neighbor of degree one contributes nothing,
since ln(1) is zero and the term is undefined rather than large.
ResourceAllocation
Shared neighbors weighted by 1 / degree, which penalizes popular neighbors
harder than Adamic-Adar does.
PreferentialAttachment
The product of the two degrees, on the theory that busy nodes attract more edges. This one ignores shared neighbors entirely, so it scores pairs that have nothing in common.
Trait Implementations§
Source§impl Clone for LinkPredictionMetric
impl Clone for LinkPredictionMetric
Source§fn clone(&self) -> LinkPredictionMetric
fn clone(&self) -> LinkPredictionMetric
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for LinkPredictionMetric
Source§impl Debug for LinkPredictionMetric
impl Debug for LinkPredictionMetric
Source§impl<'de> Deserialize<'de> for LinkPredictionMetric
impl<'de> Deserialize<'de> for LinkPredictionMetric
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LinkPredictionMetric, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LinkPredictionMetric, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for LinkPredictionMetric
Source§impl Hash for LinkPredictionMetric
impl Hash for LinkPredictionMetric
Source§impl PartialEq for LinkPredictionMetric
impl PartialEq for LinkPredictionMetric
Source§impl Serialize for LinkPredictionMetric
impl Serialize for LinkPredictionMetric
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,
impl StructuralPartialEq for LinkPredictionMetric
Auto Trait Implementations§
impl Freeze for LinkPredictionMetric
impl RefUnwindSafe for LinkPredictionMetric
impl Send for LinkPredictionMetric
impl Sync for LinkPredictionMetric
impl Unpin for LinkPredictionMetric
impl UnsafeUnpin for LinkPredictionMetric
impl UnwindSafe for LinkPredictionMetric
Blanket Implementations§
impl<T> Allocation for T
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
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
key and return true if they are equal.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> ⓘ
impl<T> OrderedSeq<'_, T> for Twhere
T: Clone,
Source§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
WrappingSpan::make_wrapped to wrap an AST node in a span.