learning weights & prediction