Enum linfa_preprocessing::tf_idf_vectorization::TfIdfMethod [−][src]
pub enum TfIdfMethod {
Smooth,
NonSmooth,
Textbook,
}
Expand description
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
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for TfIdfMethod
impl Send for TfIdfMethod
impl Sync for TfIdfMethod
impl Unpin for TfIdfMethod
impl UnwindSafe for TfIdfMethod
Blanket Implementations
Mutably borrows from an owned value. Read more