pub struct RecommendationContext {
pub preferences: HashMap<String, f64>,
pub history: Vec<String>,
pub ratings: HashMap<String, f64>,
pub interests: Vec<String>,
}Expand description
Context for generating recommendations.
Fields§
§preferences: HashMap<String, f64>User preferences
history: Vec<String>Previously viewed schemas
ratings: HashMap<String, f64>Explicit user ratings
interests: Vec<String>Tags or categories of interest
Implementations§
Source§impl RecommendationContext
impl RecommendationContext
pub fn new() -> Self
pub fn with_preference(self, key: impl Into<String>, value: f64) -> Self
pub fn with_history(self, schema_id: impl Into<String>) -> Self
pub fn with_rating(self, schema_id: impl Into<String>, rating: f64) -> Self
pub fn with_interest(self, tag: impl Into<String>) -> Self
Trait Implementations§
Source§impl Clone for RecommendationContext
impl Clone for RecommendationContext
Source§impl Debug for RecommendationContext
impl Debug for RecommendationContext
Auto Trait Implementations§
impl Freeze for RecommendationContext
impl RefUnwindSafe for RecommendationContext
impl Send for RecommendationContext
impl Sync for RecommendationContext
impl Unpin for RecommendationContext
impl UnsafeUnpin for RecommendationContext
impl UnwindSafe for RecommendationContext
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