Enum linfa_preprocessing::tf_idf_vectorization::TfIdfMethod [−][src]
pub enum TfIdfMethod {
Smooth,
NonSmooth,
Textbook,
}Methods for computing the inverse document frequency of a vocabulary entry
Variants
Computes the idf as log(1+n/1+document_frequency) + 1. The “plus ones” inside the log
add an artificial document containing every vocabulary entry, preventing divisions by zero.
The “plus one” after the log allows vocabulary entries that appear in every document to still be considered with
a weight of one instead of being completely discarded.
Computes the idf as log(n/document_frequency) +1. The “plus one” after the log allows vocabulary entries that appear in every document to still be considered with
a weight of one instead of being completely discarded. If a vocabulary entry has zero document frequency this will produce a division by zero.
Textbook definition of idf, computed as log(n/ 1 + document_frequency) which prevents divisions by zero and discards entries that appear in every document.
Implementations
impl TfIdfMethod[src]
impl TfIdfMethod[src]pub fn compute_idf(&self, n: usize, df: usize) -> f64[src]
Trait Implementations
impl Clone for TfIdfMethod[src]
impl Clone for TfIdfMethod[src]fn clone(&self) -> TfIdfMethod[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
Auto Trait Implementations
impl RefUnwindSafe for TfIdfMethod
impl RefUnwindSafe for TfIdfMethodimpl Send for TfIdfMethod
impl Send for TfIdfMethodimpl Sync for TfIdfMethod
impl Sync for TfIdfMethodimpl Unpin for TfIdfMethod
impl Unpin for TfIdfMethodimpl UnwindSafe for TfIdfMethod
impl UnwindSafe for TfIdfMethod