FirstBatch SDK

Parameters & Tuning

FirstBatch SDK provides different parameters for different batch types. Each parameter serves a distinct functionality.
mu: float = 0.0
alpha: float = 0.0
r: float = 0.0
last_n: int = 0
n_topics: int = 0
remove_duplicates: bool = True
apply_threshold: Tuple[bool, float] = (False, 0.0)
apply_mmr: bool = False

What Params do?

mu -> Exploration Intensity
Works with: Personalized, Biased
Exploration means to interpolate query vectors to close related "outer context". For instance a query vector of the context Japanese Cuisine & Sushi may converge to a vector about Japanese Kitchen Blades & Katanas based on how intense the mu is. The parameter mu determines exploration intensity.
FirstBatch prepares specially generated vectors, called "Sketches" from within the distribution of the original vector space to move n-dimensional vectors in distinct directions. The amount of "moving" done is determined by mu.
alpha -> Exploration variety
Works with: Personalized, Biased
Besides the intensity of exploration, alpha determines exploration variety. Meaning that a low alpha value would generate a single, nudged vector from a single input vector. As the alpha increases, a single vector will generate multiple vectors each nudged in distinct directions. For instance, the Japanese Cuisine & Sushi context would return both a Japanese Kitchen Blades & Katanas and a Thailand Cuisine context with increased alpha.
r -> Randomness
Works with: Personalized, Biased
Randomness will replace a certain percentage of calculated query vectors with random vectors. This is useful when we want to display personalized content along with some random content to leave space for random exploration.
last_n -> Use last n signals
Works with: Personalized, Biased
Users can add hundreds of signals during a session and more with persistent sessions. Though data is useful, some signals might be outdated or irrelevant. Parameter last_n forces FirstBatch to use only last_n signals for query vector calculation.
n_topics -> number of topics
Works with: Sampled
The parameter n_topics will bring distinct n vectors from vector space.
remove_duplicates -> Removes duplicates from batch results
Works with: Personalized, Biased, Sampled, Random
apply_threshold ->Applies threshold
Works with: Personalized, Biased, Sampled, Random
Parameter apply_threshold removes results with scores lower (or higher based on the distance metric) than a given threshold.
apply_mmr -> Max Marginal Relevance
Works with: Personalized, Biased, Sampled, Random
Applies max marginal relevance to enhance result quality by increasing diversity.