pub struct UniBall<U: Number> { /* private fields */ }
Expand description
A UniBall
is a cluster that behaves as clusters used to before the introduction
of the Cluster
trait.
A UniBall
has a center and a radius, and (optionally) has two children.
Trait Implementations§
source§impl<U: Number> Cluster<U> for UniBall<U>
impl<U: Number> Cluster<U> for UniBall<U>
source§fn new_root<I: Instance, D: Dataset<I, U>>(data: &D, seed: Option<u64>) -> Self
fn new_root<I: Instance, D: Dataset<I, U>>(data: &D, seed: Option<u64>) -> Self
Creates a new
Cluster
from a given dataset.source§fn partition<I: Instance, D: Dataset<I, U>, P: PartitionCriterion<U>>(
self,
data: &mut D,
criteria: &P,
seed: Option<u64>
) -> Self
fn partition<I: Instance, D: Dataset<I, U>, P: PartitionCriterion<U>>( self, data: &mut D, criteria: &P, seed: Option<u64> ) -> Self
Recursively partitions the
Cluster
until the PartitionCriteria
are met.source§fn offset(&self) -> usize
fn offset(&self) -> usize
The offset of the indices of the
Cluster
’s instances in the dataset.source§fn cardinality(&self) -> usize
fn cardinality(&self) -> usize
The number of points in the cluster.
source§fn arg_center(&self) -> usize
fn arg_center(&self) -> usize
source§fn arg_radial(&self) -> usize
fn arg_radial(&self) -> usize
The index of the instance with the maximum distance from the
center
source§fn polar_distance(&self) -> Option<U>
fn polar_distance(&self) -> Option<U>
The distance between the two poles of the
Cluster
used for partitioning.source§fn arg_poles(&self) -> Option<[usize; 2]>
fn arg_poles(&self) -> Option<[usize; 2]>
The indices of the instances used as poles for partitioning.
source§fn is_ancestor_of(&self, other: &Self) -> bool
fn is_ancestor_of(&self, other: &Self) -> bool
Whether the
Cluster
is an ancestor of another Cluster
.source§fn is_descendant_of(&self, other: &Self) -> bool
fn is_descendant_of(&self, other: &Self) -> bool
Whether the
Cluster
is a descendant of another Cluster
.source§fn is_singleton(&self) -> bool
fn is_singleton(&self) -> bool
Whether the
Cluster
is a singleton, i.e. it contains only one instance or has a radius of zero.source§fn indices(&self) -> Range<usize>
fn indices(&self) -> Range<usize>
The indices of the instances in the
Cluster
after the dataset has been reordered.source§fn max_leaf_depth(&self) -> usize
fn max_leaf_depth(&self) -> usize
The maximum depth of and leaf in the subtree of the
Cluster
. Read moresource§fn distance_to_instance<I: Instance, D: Dataset<I, U>>(
&self,
data: &D,
instance: &I
) -> U
fn distance_to_instance<I: Instance, D: Dataset<I, U>>( &self, data: &D, instance: &I ) -> U
Distance from the
center
to the given instance.source§fn distance_to_other<I: Instance, D: Dataset<I, U>>(
&self,
data: &D,
other: &Self
) -> U
fn distance_to_other<I: Instance, D: Dataset<I, U>>( &self, data: &D, other: &Self ) -> U
Distance from the
center
of this Cluster
to the center of the
other
Cluster
.source§fn overlapping_children<I: Instance, D: Dataset<I, U>>(
&self,
data: &D,
query: &I,
radius: U
) -> Vec<&Self>
fn overlapping_children<I: Instance, D: Dataset<I, U>>( &self, data: &D, query: &I, radius: U ) -> Vec<&Self>
Assuming the
Cluster
overlaps with the query ball, we return only
those children that also overlap with the query ball.source§impl<'de, U: Number> Deserialize<'de> for UniBall<U>
impl<'de, U: Number> Deserialize<'de> for UniBall<U>
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl<U: Number> Ord for UniBall<U>
impl<U: Number> Ord for UniBall<U>
source§impl<U: Number> PartialEq for UniBall<U>
impl<U: Number> PartialEq for UniBall<U>
source§impl<U: Number> PartialOrd for UniBall<U>
impl<U: Number> PartialOrd for UniBall<U>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<U: Number> Eq for UniBall<U>
Auto Trait Implementations§
impl<U> RefUnwindSafe for UniBall<U>where
U: RefUnwindSafe,
impl<U> Send for UniBall<U>
impl<U> Sync for UniBall<U>
impl<U> Unpin for UniBall<U>where
U: Unpin,
impl<U> UnwindSafe for UniBall<U>where
U: UnwindSafe,
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<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.