Machine learning is when computers learn from data, so they can carry out specific tasks. An example could be when a computer learns from e-mail data to predict whether or not a message is spam. The data it learns from is called the training data, and it uses that data to build a model.