Machine learning focuses on automatically learning complex patterns and then making intelligent decisions based on data provided. .There are different machine learning algorithms used in the real world but our focus will only be on two of these algorithms namely supervised learning and unsupervised learning.
Supervised learning is a technique that defines the effect of a set of observations, called inputs has on another set of observations, called outputs (Valpola). The inputs are assumed to be at the beginning and outputs at the end of the causal chain.
The model works by training on a collection of records called the training set. Each of the records in the training set contains an attribute while one attribute is designated as the categorical variable, i.e. the one that needs to be predicted. This prediction is done by finding a model for the categorical attribute as a function of the values of the other attributes.
Once, this learning takes place, a previously unseen data set is given to the machine to assign classes to the categorical variable. The goal is to assign classes as accurately as possible. Usually the training set is divided into two segments, the training segment, and the test segment, with the training set used to build the model while the test set is used to validate its results.
Example of supervised learning is when it is applied to reduce the direct marketing costs incurred by a company. The goal is to reduce the cost of mailing by targeting a specific set of customers who are more likely to buy a new cell phone product. The approach towards solving this problem will be to first use data for a similar product. Then, collect various demographics i.e. age, lifestyle, income, company interaction, technological knowledge, etc. Once, all these attributes are collected we will use this information as input attributes to learn a classifier model. Then the model will be used to predict the dataset of the current customers, only the ones’ who will have a high probability of buying will be targeted (Linoff, 1997). .  .