# [2019.07.11] Negative Sampling

Using deep learning for the recommender system is a task far from
trivial. The latest code published by Facebook assumes that there are
both positive and negative examples in your training dataset. That's
true for advertising: you show banner and then, either user clicks on
it or not. It recommenders it's not always the case: you can have
only positive interactions. You know how people buy goods but have
absolutely no idea of how they don't. So you need to generate your
negatives on the fly, drawing them at random from all the invisible
cases of people not buying goods. This strategy is not hard to
implement in PyTorch but not very common among other DL
practitioners.