Introduction to Machine Learning
“Computers are able to see, hear and learn. Welcome to the future.”
- Machine Learning is a study of various types of algorithms of Artificial Intelligence that enabled self-learning from data without explicitly programmed.
- With this technology, computers can learn by themselves and improve their accuracy and experience over a period of time.
- The primary goal of ML is to observe the given problem or a dataset and determine the hidden patterns and relationships and extract details/information which helps in data-driven decision making and provides insights.
Any dataset has some terminologies that help us while choosing an appropriate ML model.
There are mainly three types of learnings:
- Supervised Learning
- Unsupervised Learning
- Reinforcement Learning
Supervised Learning :
- A type of machine learning called supervised learning uses pre-labeled data to train a machines or models, which predicts the output based on the labelled data. Labeled data means that the input data can already be tagged with the desired output.
- When a given dataset has features, observations, and responses, this type of ML(Supervised) becomes more accurate and effective. Supervised Learning can also be described as task-oriented learning. These types of algorithms predict the output for a given new data/input.
- With supervised learning, the goal is to find the mapping function that maps the input variables (x) to the output variables (y).
- The real-world applications of supervised learning include risk assessment, image classification, fraud detection, spam filtering, and others.
Suppose we have a dataset that contains the number of hours of student study as well as corresponding percentages they have got. So, we can say that we are given input/features(Hours) and output/label/response(Percentage).
Which means we can train our model by hours and percentage. For testing purposes, we can take new data as an input and check the corresponding output and determine whether it is accurate or not.
Supervised ML can also be further categorized into two group
- Regression (It is used when data is continuous):
It is an optimal method to distinguish the relationship between a dependent and one or more dependent variables.
- Classification (It is used when data is categorical):
It is a Supervised Learning technique that is used to determine the class of new observations on the basis of training data.
It predicts categorical labels also called classes or categories.
Steps involved in Supervised Learning:
- Determine the type of training dataset or identify the domain of problem.
- Collect the data according to your requirement that must be correlate with domain you have chosen.
- Split the gathered data into training data, test data and validation data.
- Determine the input features of the training dataset, which must have appropriate knowledge so that model can accurately predict the relevant output.
- Select suitable algorithm for your problem and your data.
- Apply the algorithm to the training dataset. Sometimes, validation sets are needed as control parameters.
- The test set should be used to determine the accuracy of the model.
Supervised Learning algorithms:
- Linear Regression
- Logistic Regression
- Decision Tree
- SVM(Support Vector Machine)
- Naive Bayes
- K-nearest neighbors
- Random Forest
- Dimensionality Reduction Algorithms
- Gradient Boosting Algorithms
Generalization refers to your model’s ability to adapt properly to new, previously unseen data, drawn from the same distribution as the one used to create the model.
Unsupervised Learning :
- This is a type of machine learning in which models are trained using the unlabeled dataset like images, audio, videos, x-rays, etc.
- It is an optimal ML technique in which the user does not need to supervise the model, instead, it allows the model to work on and discover patterns that’s why it is termed as self-organized learning.
- Unsupervised Learning performs the more complex tasks as compared to supervised learning but there is always a problem of the unpredictability of the model.
- The primary goal of Unsupervised Learning is to find the structure of data and group them according to their similarities and associativity and represent data into a more compressed format.
“Unsupervised learning is a type of machine learning in which models are trained using unlabeled dataset and are allowed to act on that data without any supervision.”
Unsupervised ML can also be further categorized into two group
A simple way of grouping the data points into various clusters. The objects or points having similarities remain in a group.
Association rules allow you to institute associations amongst data objects inside large datasets. This unsupervised method is about discovering interesting relationships between variables in large datasets. For example, people that buy a new car are most likely to buy insurance.
Unsupervised Learning algorithms:
- K-means clustering
- KNN (k-nearest neighbors)
- Neural Networks
- Apriori algorithm
- Hierarchal clustering
- Anomaly detection
- Independent Component Analysis
- Principle Component Analysis
Reinforcement Learning :
- It is a feed-back based machine learning technique in which agent learns to behave in an environment by performing the actions and seeing the results of actions. For good action agent gets positive feedback and for dull action agent gets negative feedback or penalty.
- In reinforcement learning the agent learns automatically using feedbacks without any labeled data unlike supervised learning. Agent interacts directly with the environment and explore it by itself.
- The main purpose of the reinforcement learning is to improve the accuracy and performance by getting maximum positive feedbacks or rewards.
“Reinforcement Learning is a type of machine learning method where an intelligent agent or computer program interact with the environment and learn to act within that”.
- Feedback that agent gets after performing an action from the environment is called “Reward Signal”. Reinforcement learning (RL) deals with the ability of learning the associations between stimuli, actions, and the occurrence of pleasant events, called rewards, or unpleasant events called punishments.
Terms used in Reinforcement Learning
- Agent(): An entity that can perceive the environment and act upon it.
- Environment(): A situation in which an agent is present or surrounded by.
- Action(): Actions are the activities taken by an agent within the environment.
- State(): State is a situation returned by the environment after each action taken by the agent.
- Reward(): A feedback returned to the agent from the environment to evaluate the action of the agent.
- Policy(): Policy is a strategy applied by the agent for the next action based on the current state.
- Value(): It is expected long-term retuned with the discount factor and opposite to the short-term reward.
- Q-value(): It is mostly similar to the value, but it takes one additional parameter as a current action (a).
Elements of Reinforcement Learning
A policy can be defined as a way how an agent behaves at a given time. Policy is a core element of the RL, since it is the only thing that defines how the agent behaves.
- Reward Function/Signal
As the learning agent moves from one state to the next, the environment sends an immediate signal called a reward signal. Agents are rewarded depending on their good or bad behavior.
- Value Function
The value function provides information about the situation and the agent’s actions, as well as how much reward an agent is likely to receive. Reward functions indicate the immediate signal of each good or bad action, while value functions describe future states and actions.
Reinforcement learning also involves the model, which mimics the behavior of the environment. The model is used for organizing, which means it provides a method to take a course of action by considering all future situations before actually experiencing those situations.
Applications of Reinforcement Learning
- Self-driving vehicles
- industry Automation
- Finance Sector
- Healthcare domain
- News Recommendation System
- Image Processing
A mobile trash collecting robot decides whether it should enter a new room in search of more trash to collect or start to find a way to get back to it battery recharge station. This decision is made based on how quickly and easily it has been able to find the recharge in past. This can be done by reinforcement learning algorithm.
Applications of Machine Learning
- Image and Speech recognition.
- Product Recommendation.
- Sentiment Analysis.
- Language Translation.
- Chatbots(Virtual Person Assistants).
- Fraud, spam emails Detection.
- Sorting, tagging, categorizing photos.
- Enabling business intelligence.
- Medical Diagnosis.
- Self-driving Vehicles.