lerot.ranker

class lerot.ranker.DeterministicRankingFunction(ranker_arg_str, ties, feature_count, init='random', sample='sample_unit_sphere')[source]

Bases: lerot.ranker.AbstractRankingFunction.AbstractRankingFunction

document_count()[source]
getDocs(numdocs=None)[source]

Copied from StatelessRankingFunction.

get_document_probability(docid)[source]

get probability of producing doc as the next document drawn

init_ranking(query)[source]
next()[source]

produce the next document

next_det()[source]
next_random()[source]

produce a random next document

rm_document(docid)[source]

remove doc from list of available docs and adjust probabilities

class lerot.ranker.ModelRankingFunction[source]

Bases: lerot.ranker.StatelessRankingFunction.StatelessRankingFunction

add_doc_for_query(query, doc)[source]
init_ranking(query)[source]
update_weights(new_weights)[source]
class lerot.ranker.ProbabilisticRankingFunction(ranker_arg_str, ties, feature_count, init='random', sample='sample_unit_sphere')[source]

Bases: lerot.ranker.AbstractRankingFunction.AbstractRankingFunction

document_count()[source]
getDocs(numdocs=None)[source]

Copied from StatelessRankingFunction.

get_document_probability(docid)[source]

get probability of producing doc as the next document drawn

get_ranking()[source]
init_ranking(query)[source]
next()[source]

produce the next document by random sampling, or deterministically

next_det()[source]
next_random()[source]

produce a random next document

rm_document(docid)[source]

remove doc from list of available docs and adjust probabilities

class lerot.ranker.StatelessRankingFunction(ranker_arg_str, ties, feature_count, init='random', sample='sample_unit_sphere')[source]

Bases: lerot.ranker.AbstractRankingFunction.AbstractRankingFunction

document_count()[source]
getDocs(numdocs=None)[source]

More efficient and less error-prone version of getDocs.

init_ranking(query)[source]

Initialize ranking for particular query.

Since AbstractRankingFunction has a next() function that changes a state, we need to have a support for that. You need to set self.docs and the only stateful object self.doc_idx

next()[source]
next_det()[source]
next_random()[source]
rm_document(doc)[source]
verticals(length=None)[source]
class lerot.ranker.SyntheticDeterministicRankingFunction(synthetic_docs)[source]

Bases: lerot.ranker.StatelessRankingFunction.StatelessRankingFunction

Synthetic deterministic ranker.

get_document_probability(doc)[source]

Get probability of producing doc as the next document drawn.

init_ranking(query)[source]
update_weights(new_weights)[source]
class lerot.ranker.SyntheticProbabilisticRankingFunction(ranker_arg_str, ties='random')[source]

Bases: lerot.ranker.ProbabilisticRankingFunction.ProbabilisticRankingFunction

Synthetic ranker for use in this experiment only

get_document_probability(docid)[source]

get probability of producing doc as the next document drawn

init_ranking(synthetic_docids)[source]
rm_document(docid)[source]

remove doc from list of available docs, adjust probabilities

update_weights(new_weights)[source]

not required under synthetic data