Trait sbr::OnlineRankingModel [−][src]
pub trait OnlineRankingModel { type UserRepresentation: Debug; fn user_representation(
&self,
item_ids: &[ItemId]
) -> Result<Self::UserRepresentation, PredictionError>; fn predict(
&self,
user: &Self::UserRepresentation,
item_ids: &[ItemId]
) -> Result<Vec<f32>, PredictionError>; }
Trait describing models that can compute predictions given a user's sequences of past interactions.
Associated Types
type UserRepresentation: Debug
The representation the model computes from past interactions.
Required Methods
fn user_representation(
&self,
item_ids: &[ItemId]
) -> Result<Self::UserRepresentation, PredictionError>
&self,
item_ids: &[ItemId]
) -> Result<Self::UserRepresentation, PredictionError>
Compute a user representation from past interactions.
fn predict(
&self,
user: &Self::UserRepresentation,
item_ids: &[ItemId]
) -> Result<Vec<f32>, PredictionError>
&self,
user: &Self::UserRepresentation,
item_ids: &[ItemId]
) -> Result<Vec<f32>, PredictionError>
Given a user representation, rank item_ids
according
to how likely the user is to interact with them in the future.
Implementors
impl OnlineRankingModel for ImplicitEWMAModel type UserRepresentation = ImplicitUser;
impl OnlineRankingModel for ImplicitLSTMModel type UserRepresentation = ImplicitUser;
impl<U: SequenceModel, T: SequenceModelParameters<Output = U> + Sync> OnlineRankingModel for T type UserRepresentation = ImplicitUser;