Perform weighting outside of MLLIB for maximum flexibility.