pub struct HybridRecommender { /* private fields */ }Expand description
Hybrid recommender combining content-based and collaborative filtering
Implementations§
Source§impl HybridRecommender
impl HybridRecommender
Sourcepub fn add_item(
&mut self,
id: impl Into<String>,
vector: Vec<f32>,
metadata: Metadata,
) -> Result<()>
pub fn add_item( &mut self, id: impl Into<String>, vector: Vec<f32>, metadata: Metadata, ) -> Result<()>
Add item to content-based catalog
Sourcepub fn add_rating(
&mut self,
user_id: impl Into<String>,
item_id: impl Into<String>,
rating: f32,
)
pub fn add_rating( &mut self, user_id: impl Into<String>, item_id: impl Into<String>, rating: f32, )
Add rating for collaborative filtering
Sourcepub fn recommend(
&self,
user_id: &str,
preferences: &[UserPreference],
top_k: usize,
) -> Result<Vec<Recommendation>>
pub fn recommend( &self, user_id: &str, preferences: &[UserPreference], top_k: usize, ) -> Result<Vec<Recommendation>>
Get hybrid recommendations
Auto Trait Implementations§
impl Freeze for HybridRecommender
impl RefUnwindSafe for HybridRecommender
impl Send for HybridRecommender
impl Sync for HybridRecommender
impl Unpin for HybridRecommender
impl UnwindSafe for HybridRecommender
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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