#[non_exhaustive]pub struct DbscanConfig {
pub eps: f64,
pub min_points: usize,
}Expand description
Configuration for DBSCAN density clustering over functional data.
DBSCAN discovers clusters of arbitrary shape by expanding dense
regions of curves in functional L2 distance space. Curves that
do not belong to any dense region are flagged as noise (None
in DbscanResult::cluster).
§Distance units
eps is in the same units as l2_distance_matrix — that is,
functional L2 distance with Simpson’s-rule integration weights.
For a constant-1 curve on argvals spanning [0, 1], the L2 norm
is ≈ 1.0. As a practical starting point, set eps to a fraction
(e.g. 0.1–0.5) of the dataset’s median pairwise L2 distance:
let dist = l2_distance_matrix(&data, &argvals);
let n = data.nrows();
let mut upper: Vec<f64> = Vec::new();
for i in 0..n {
for j in (i + 1)..n {
upper.push(dist[(i, j)]);
}
}
upper.sort_by(|a, b| a.partial_cmp(b).unwrap());
let median_dist = upper[upper.len() / 2];
let eps = 0.3 * median_dist; // start here, tune as needed
let _ = eps;Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.eps: f64Neighbourhood radius in functional L2 distance units (default: 0.5).
Must be strictly positive (eps > 0). A tiny positive value makes
every curve a noise point; a very large value merges everything into
one cluster.
min_points: usizeMinimum number of curves (including the point itself) required in the
eps-neighbourhood for a point to be considered a core point (default: 3).
Must be ≥ 1.
Trait Implementations§
Source§impl Clone for DbscanConfig
impl Clone for DbscanConfig
Source§fn clone(&self) -> DbscanConfig
fn clone(&self) -> DbscanConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DbscanConfig
impl Debug for DbscanConfig
Source§impl Default for DbscanConfig
impl Default for DbscanConfig
Source§impl PartialEq for DbscanConfig
impl PartialEq for DbscanConfig
impl StructuralPartialEq for DbscanConfig
Auto Trait Implementations§
impl Freeze for DbscanConfig
impl RefUnwindSafe for DbscanConfig
impl Send for DbscanConfig
impl Sync for DbscanConfig
impl Unpin for DbscanConfig
impl UnsafeUnpin for DbscanConfig
impl UnwindSafe for DbscanConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.