pub struct LocalOutlierFactor {
pub n_neighbors: usize,
pub contamination: f64,
pub algorithm: String,
pub scores: Option<Vec<f64>>,
pub feature_columns: Option<Vec<String>>,
}Expand description
Local Outlier Factor for anomaly detection
Local Outlier Factor computes the local density deviation of a point with respect to its neighbors, identifying points that have significantly lower density than their neighbors.
Fields§
§n_neighbors: usizeNumber of neighbors to consider
contamination: f64Contamination: expected proportion of outliers in the data
algorithm: StringAlgorithm to use for nearest neighbors search
scores: Option<Vec<f64>>Anomaly scores (-1 for anomalies, 1 for normal points)
feature_columns: Option<Vec<String>>Feature columns used for anomaly detection
Implementations§
Source§impl LocalOutlierFactor
impl LocalOutlierFactor
Sourcepub fn anomaly_scores(&self) -> &[f64]
pub fn anomaly_scores(&self) -> &[f64]
Get anomaly scores
Sourcepub fn contamination(self, contamination: f64) -> Self
pub fn contamination(self, contamination: f64) -> Self
Set contamination (expected proportion of outliers)
Sourcepub fn with_columns(self, columns: Vec<String>) -> Self
pub fn with_columns(self, columns: Vec<String>) -> Self
Specify feature columns to use
Trait Implementations§
Source§impl Clone for LocalOutlierFactor
impl Clone for LocalOutlierFactor
Source§fn clone(&self) -> LocalOutlierFactor
fn clone(&self) -> LocalOutlierFactor
Returns a duplicate of the value. Read more
1.0.0 · 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 LocalOutlierFactor
impl Debug for LocalOutlierFactor
Source§impl ModelEvaluator for LocalOutlierFactor
impl ModelEvaluator for LocalOutlierFactor
Auto Trait Implementations§
impl Freeze for LocalOutlierFactor
impl RefUnwindSafe for LocalOutlierFactor
impl Send for LocalOutlierFactor
impl Sync for LocalOutlierFactor
impl Unpin for LocalOutlierFactor
impl UnwindSafe for LocalOutlierFactor
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,
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