def WeightedMajority(predictors, weights):
def predict(example):<EOL><INDENT>return weighted_mode((predictor(example) for predictor in predictors),<EOL>weights)<EOL><DEDENT>return predict<EOL>
Return a predictor that takes a weighted vote.