tarexp.component.ranker module#

TARexp supports classification models implemented in Scikit-learn through tarexp.component.ranker.SklearnRanker wrapper. However, any supervised learning model that can produce a score for each document in the collection can be integrated into TARexp.

Caution

For rankers that require allocating a lot of memory or carries states (e.g. neural models and SGDClassifier in sklearn that supports partial_fit), it would be ideal to put the actual model initialization into .begin method and properly dispose the model instance in .reset method.

class tarexp.component.ranker.Ranker(**kwargs)[source]#

Bases: Component

trainRanker(X, y, *args, **kwargs)[source]#
scoreDocuments(X, *args, **kwargs)[source]#
class tarexp.component.ranker.SklearnRanker(module, **kwargs)[source]#

Bases: Ranker

reset()[source]#
trainRanker(X, y, **kwargs)[source]#
scoreDocuments(X, **kwargs)[source]#
tarexp.component.ranker.addDummyNeg(X, y)[source]#