Supervised machine learning
Supervised machine learning : The machine called learning it from past experiences concerning with respect to some class of Tasks. The performance in the task will improve the Experience. It is the task of learning function that will map an input to an output based on the input-output pairs.
It will infer in a function from labeled data consisting of set of trainingexamples.
Each example is a pair that consists of an input object and a desired output value.
This algorithm analyzes the training data and produces a function which can be used for mapping examples.
This requires the learning algorithm to generalize it from training data to unseen situations in the "reasonable" way.
Supervised learning is the model of getting trained on a labeled dataset.
Labeled dataset is one which has input and output parameters.
- Figure A:
The dataset of a shopping store which is useful in predicting whether a customer will purchase a particular product under consideration.
Based on his/ her gender, age and salary.
Input: Gender, Age, Salary.
Output: 0 or 1, 1 mean yes the customer that will purchase and 0 means customer won’t purchase it
- Figure B: It is the meteorological dataset which serves the purpose of predicting wind speed based on different parameters.
Input: Temperature, Pressure, Relative Humidity, Wind Direction.
Output: Wind Speed.
Following are the types of Supervised Learning:-
- Classification: It is the task where output is having defined labels.
- Regression: It is a Supervised Learning task where the output is having continuous value
The goal is to produce accurate mapping functions that when new input is given the algorithm can predict the output.
Training data for supervised learning will include a set of examples with paired input subjects.
After a sufficient observation the system should be able to distinguish between and unlabeled images at which time the training is complete.
The common supervised machine learning algorithms are:-
- Linear regression.
- Logistic regression.
- Decision trees.
- Similarity learning.
- Bayesian logic.
- Support vector machines (SVM).
- Random forests.
- Artificial neural networks (ANN).
- Linear discriminant analysis.
You have input (x) and output (Y) so the supervised machine learning algorithm would be,
Y = f(x)
Supervised machine learning applications are all about:-
- We scale the scope of data.
- Uncovering the hidden patterns in the data.
- Extracting the most relevant insights.
- Discovering relationships between entities.
- Enabling predictions of the future outcomes based on available data.
This algorithm is trained on a labeled dataset where input and output are clearly defined.
The working of Supervised learning can be easily understood by the below example and diagram:
We have a dataset of different types of shapes that includes square, rectangle, triangle, and Polygon.
We need to train the model for each shape,
- If the given shape has four sides and the sides are equal, then it will be labeled as a Square.
- If the given shape has three sides then it will be labeled as a triangle.
- If the given shape has six equal sides then it will be labeled as hexagon.
Steps Involved in Supervised Learning:-
- Determine the type of training dataset
- Gather the labeled training data.
- Split the training dataset into training dataset, test dataset, and validation dataset.
- Determine the input features of the training dataset, which should have enough knowledge so that the model can accurately predict the output.
- Determine the suitable algorithm for the model, such as support vector machine.
- Execute the algorithm on the training dataset. Sometimes we need validation sets as the control parameters, which are the subset of training datasets.
- Evaluate the accuracy of the model by providing the test set. If the model predicts the correct output, which means our model is accurate.
1. Regression
The regression algorithms are used if there is a relationship between the input variable and the output variable.
It is used for the prediction of continuous variables, as Weather forecasting, Market Trends, etc.
- Linear Regression
- Regression Trees
- Non-Linear Regression
- Bayesian Linear Regression
- Polynomial Regression
2. Classification
The classification algorithm are used when the output variable is categorical that means there are two classes such as Yes-No, Male-Female, True-false, etc.
- Random Forest
- Decision Trees
- Logistic Regression
- Support vector Machines
Advantages of Supervised learning:-
- The model can predict the output on basis of prior experiences.
- We can have an exact idea about the classes of objects.
- The model helps us to solve various real-world problems such as fraud detection, spam filtering, etc.
Disadvantages of supervised learning:-
- The models are not suitable for handling the complex tasks.
- It cannot predict the correct output if the test data is different from the training dataset.
- Training requires a lot of computation times.
- We need knowledge about the classes of object.