NegativeSamplerBase

class rectools.models.ranking.candidate_ranking.NegativeSamplerBase[source]

Bases: object

A base class for negative sampling.

Inherited-members

Methods

sample_negatives(train)

Sample negative examples from the given training data.

sample_negatives(train: DataFrame) DataFrame[source]

Sample negative examples from the given training data.

Parameters

train (pd.DataFrame) – A DataFrame containing the training data from which negative examples will be sampled.

Returns

A DataFrame containing the sampled negative examples.

Return type

pd.DataFrame