lerot.retrieval_system

class lerot.retrieval_system.ListwiseLearningSystem(feature_count, arg_str)[source]

Bases: lerot.retrieval_system.AbstractLearningSystem.AbstractLearningSystem

A retrieval system that learns online from listwise comparisons. The system keeps track of all necessary state variables (current query, weights, etc.) so that comparison and learning classes can be stateless (implement only static / class methods).

get_ranked_list(query, getNewCandidate=True)[source]
get_solution()[source]
update_solution(clicks)[source]
class lerot.retrieval_system.PrudentListwiseLearningSystem(feature_count, arg_str)[source]

Bases: lerot.retrieval_system.AbstractLearningSystem.AbstractLearningSystem

A retrieval system that learns online from listwise comparisons. The system keeps track of all necessary state variables (current query, weights, etc.) so that comparison and learning classes can be stateless (implement only static / class methods).

get_outcome(clicks)[source]
get_ranked_list(query, getNewCandidate=True)[source]
get_solution()[source]
update_solution()[source]
class lerot.retrieval_system.ListwiseLearningSystemWithCandidateSelection(feature_count, arg_str)[source]

Bases: lerot.retrieval_system.ListwiseLearningSystem.ListwiseLearningSystem

A retrieval system that learns online from listwise comparisons, and pre-selects exploratory rankers using historic data.

select_candidate_beat_the_mean(candidate_us)[source]
select_candidate_random(candidates)[source]
select_candidate_repeated(candidates)[source]

Selects a ranker in randomized matches. Ranker pairs are sampled uniformly and compared over a number of historical samples. The outcomes observed over these samples are averaged (with / without importance sampling). The worse-performing ranker is removed from the pool. If no preference is found, the ranker to be removed is selected randomly. The final ranker in the pool is returned. This selection method assumes transitivity.

select_candidate_simple(candidates)[source]

Selects a ranker in randomized matches. For each historic data point two rankers are randomly selected from the pool and compared. If a ranker loses the comparison, it is removed from the pool. If there is more than one ranker left when the history is exhausted, a ranker is randomly selected from the remaining pool. This selection method assumes transitivity (a ranker that loses against one ranker is assumed to not be the best ranker).

class lerot.retrieval_system.PairwiseLearningSystem(feature_count, arg_str)[source]

Bases: lerot.retrieval_system.AbstractLearningSystem.AbstractLearningSystem

A retrieval system that learns online from pairwise comparisons. The system keeps track of all necessary state variables (current query, weights, etc.).

get_ranked_list(query)[source]
get_solution()[source]
initialize_weights(method, feature_count)[source]
sample_fixed(n)[source]
sample_unit_sphere(n)[source]

See http://mathoverflow.net/questions/24688/efficiently-sampling- points-uniformly-from-the-surface-of-an-n-sphere

update_solution(clicks)[source]

“Ranker weights are updated after each observed document pair. This means that a pair may have been misranked when the result list was gen- erated, but is correctly labeled after an earlier update based on a higher-ranked pair from the same list.

class lerot.retrieval_system.SamplerSystem(feature_count, arg_str, run_count='')[source]

Bases: lerot.retrieval_system.AbstractLearningSystem.AbstractLearningSystem

get_ranked_list(query)[source]
get_solution()[source]
update_solution(clicks)[source]
class lerot.retrieval_system.PerturbationLearningSystem(feature_count, arg_str)[source]

Bases: lerot.retrieval_system.AbstractLearningSystem.AbstractLearningSystem

A retrieval system that learns online from pairwise comparisons. The system keeps track of all necessary state variables (current query, weights, etc.) so that comparison and learning classes can be stateless (implement only static / class methods).

get_ranked_list(query)[source]
get_solution()[source]
update_solution(clicks)[source]

Update the ranker weights

while keeping in mind that documents with a relevance of > 1 are clicked more than once

update_solution_once(clicks)[source]

Update the ranker weights without regard to multiple clicks on a single link