pub enum TfIdfMethod {
    Smooth,
    NonSmooth,
    Textbook,
}
Expand description

Methods for computing the inverse document frequency of a vocabulary entry

Variants

Smooth

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.

NonSmooth

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

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.