pub struct TextKernelApproximation {
pub n_components: usize,
pub max_features: usize,
pub ngram_range: (usize, usize),
pub min_df: usize,
pub max_df: f64,
pub use_tf_idf: bool,
pub use_hashing: bool,
pub sublinear_tf: bool,
}Expand description
Text kernel approximation using bag-of-words and n-gram features TextKernelApproximation
Fields§
§n_components: usizen_components
max_features: usizemax_features
ngram_range: (usize, usize)ngram_range
min_df: usizemin_df
max_df: f64max_df
use_tf_idf: booluse_tf_idf
use_hashing: booluse_hashing
sublinear_tf: boolsublinear_tf
Implementations§
Source§impl TextKernelApproximation
impl TextKernelApproximation
pub fn new(n_components: usize) -> Self
pub fn max_features(self, max_features: usize) -> Self
pub fn ngram_range(self, ngram_range: (usize, usize)) -> Self
pub fn min_df(self, min_df: usize) -> Self
pub fn max_df(self, max_df: f64) -> Self
pub fn use_tf_idf(self, use_tf_idf: bool) -> Self
pub fn use_hashing(self, use_hashing: bool) -> Self
pub fn sublinear_tf(self, sublinear_tf: bool) -> Self
Trait Implementations§
Source§impl Clone for TextKernelApproximation
impl Clone for TextKernelApproximation
Source§fn clone(&self) -> TextKernelApproximation
fn clone(&self) -> TextKernelApproximation
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 TextKernelApproximation
impl Debug for TextKernelApproximation
Source§impl<'de> Deserialize<'de> for TextKernelApproximation
impl<'de> Deserialize<'de> for TextKernelApproximation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Fit<Vec<String>, ()> for TextKernelApproximation
impl Fit<Vec<String>, ()> for TextKernelApproximation
Source§type Fitted = FittedTextKernelApproximation
type Fitted = FittedTextKernelApproximation
The fitted model type
Source§fn fit(self, documents: &Vec<String>, _y: &()) -> Result<Self::Fitted>
fn fit(self, documents: &Vec<String>, _y: &()) -> Result<Self::Fitted>
Fit the model to the provided data with validation
Source§fn fit_with_validation(
self,
x: &X,
y: &Y,
_x_val: Option<&X>,
_y_val: Option<&Y>,
) -> Result<(Self::Fitted, FitMetrics), SklearsError>where
Self: Sized,
fn fit_with_validation(
self,
x: &X,
y: &Y,
_x_val: Option<&X>,
_y_val: Option<&Y>,
) -> Result<(Self::Fitted, FitMetrics), SklearsError>where
Self: Sized,
Fit with custom validation and early stopping
Auto Trait Implementations§
impl Freeze for TextKernelApproximation
impl RefUnwindSafe for TextKernelApproximation
impl Send for TextKernelApproximation
impl Sync for TextKernelApproximation
impl Unpin for TextKernelApproximation
impl UnwindSafe for TextKernelApproximation
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