The predictor registers a set of actions according to the size of the window (the number of actions to register to make predictions) and assigns them the resulting value. For example, for a window with a size of 3, the first three are saved as a key to predict that it's possible that a fourth one may follow.
The prediction function computes how likely it is for an action to be the one that follows, given a set of previous actions. The more registered actions, the more accurate the predictor will be (with some limitations).