The Wayback Machine - https://web.archive.org/web/20240909175335/https://www.geeksforgeeks.org/getting-started-machine-learning/
Open In App

Getting started with Machine Learning

Last Updated : 08 Jan, 2024
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

From translation apps to autonomous vehicles, all powers with Machine Learning. It offers a way to solve problems and answer complex questions. It is basically a process of training a piece of software called an algorithm or model, to make useful predictions from data. This article discusses the categories of machine learning problems, and terminologies used in the field of machine learning.

Types of machine learning problems

There are various ways to classify machine learning problems. Here, we discuss the most obvious ones.

 1. On basis of the nature of the learning “signal” or “feedback” available to a learning system

  • Supervised learning: The model or algorithm is presented with example inputs and their desired outputs and then finds patterns and connections between the input and the output. The goal is to learn a general rule that maps inputs to outputs. The training process continues until the model achieves the desired level of accuracy on the training data. Some real-life examples are:
    • Image Classification: You train with images/labels. Then in the future, you give a new image expecting that the computer will recognize the new object.
    • Market Prediction/Regression: You train the computer with historical market data and ask the computer to predict the new price in the future.
  • Unsupervised learning: No labels are given to the learning algorithm, leaving it on its own to find structure in its input. It is used for clustering populations in different groups. Unsupervised learning can be a goal in itself (discovering hidden patterns in data).
    • Clustering: You ask the computer to separate similar data into clusters, this is essential in research and science.
    • High-Dimension Visualization: Use the computer to help us visualize high-dimension data.
    • Generative Models: After a model captures the probability distribution of your input data, it will be able to generate more data. This can be very useful to make your classifier more robust.

A simple diagram that clears the concept of supervised and unsupervised learning is shown below:
 
As you can see clearly, the data in supervised learning is labeled, whereas data in unsupervised learning is unlabelled.

  • Semi-supervised learning: Problems where you have a large amount of input data and only some of the data is labeled, are called semi-supervised learning problems. These problems sit in between both supervised and unsupervised learning. For example, a photo archive where only some of the images are labeled, (e.g. dog, cat, person) and the majority are unlabeled.
  • Reinforcement learning: A computer program interacts with a dynamic environment in which it must perform a certain goal (such as driving a vehicle or playing a game against an opponent). The program is provided feedback in terms of rewards and punishments as it navigates its problem space.

 

2. Two most common use cases of Supervised learning are: 

  • Classification: Inputs are divided into two or more classes, and the learner must produce a model that assigns unseen inputs to one or more (multi-label classification) of these classes and predicts whether or not something belongs to a particular class. This is typically tackled in a supervised way.  Classification models can be categorized in two groups: Binary classification and Multiclass Classification. Spam filtering is an example of binary classification, where the inputs are email (or other) messages and the classes are “spam” and “not spam”.
  • Regression: It is also a supervised learning problem, that predicts a numeric value and outputs are continuous rather than discrete. For example, predicting stock prices using historical data.

An example of classification and regression on two different datasets is shown below:

3. Most common Unsupervised learning are:

  • Clustering: Here, a set of inputs is to be divided into groups. Unlike in classification, the groups are not known beforehand, making this typically an unsupervised task. As you can see in the example below, the given dataset points have been divided into groups identifiable by the colors red, green, and blue.
  • Density estimation: The task is to find the distribution of inputs in some space.
  • Dimensionality reduction: It simplifies inputs by mapping them into a lower-dimensional space. Topic modeling is a related problem, where a program is given a list of human language documents and is tasked to find out which documents cover similar topics.

On the basis of these machine learning tasks/problems, we have a number of algorithms that are used to accomplish these tasks. Some commonly used machine learning algorithms are Linear Regression, Logistic Regression, Decision Tree, SVM(Support vector machines), Naive Bayes, KNN(K nearest neighbors), K-Means, Random Forest, etc. Note: All these algorithms will be covered in upcoming articles.

Terminologies of Machine Learning

  • Model A model is a specific representation learned from data by applying some machine learning algorithm. A model is also called a hypothesis.
  • Feature A feature is an individual measurable property of our data. A set of numeric features can be conveniently described by a feature vector. Feature vectors are fed as input to the model. For example, in order to predict a fruit, there may be features like color, smell, taste, etc. Note: Choosing informative, discriminating and independent features is a crucial step for effective algorithms. We generally employ a feature extractor to extract the relevant features from the raw data.
  • Target (Label) A target variable or label is the value to be predicted by our model. For the fruit example discussed in the features section, the label with each set of input would be the name of the fruit like apple, orange, banana, etc.
  • Training The idea is to give a set of inputs(features) and its expected outputs(labels), so after training, we will have a model (hypothesis) that will then map new data to one of the categories trained on.
  • Prediction Once our model is ready, it can be fed a set of inputs to which it will provide a predicted output(label). But make sure if the machine performs well on unseen data, then only we can say the machine performs well.

The figure shown below clears the above concepts:

Here are the steps to get started with machine learning:

  1. Define the Problem: Identify the problem you want to solve and determine if machine learning can be used to solve it.
  2. Collect Data: Gather and clean the data that you will use to train your model. The quality of your model will depend on the quality of your data.
  3. Explore the Data: Use data visualization and statistical methods to understand the structure and relationships within your data.
  4. Pre-process the Data: Prepare the data for modeling by normalizing, transforming, and cleaning it as necessary.
  5. Split the Data: Divide the data into training and test datasets to validate your model.
  6. Choose a Model: Select a machine learning model that is appropriate for your problem and the data you have collected.
  7. Train the Model: Use the training data to train the model, adjusting its parameters to fit the data as accurately as possible.
  8. Evaluate the Model: Use the test data to evaluate the performance of the model and determine its accuracy.
  9. Fine-tune the Model: Based on the results of the evaluation, fine-tune the model by adjusting its parameters and repeating the training process until the desired level of accuracy is achieved.
  10. Deploy the Model: Integrate the model into your application or system, making it available for use by others.
  11. Monitor the Model: Continuously monitor the performance of the model to ensure that it continues to provide accurate results over time.

Example :

Here is a simple machine-learning example in Python that demonstrates how to train a model to predict the species of iris flowers based on their sepal and petal measurements:

Python




# Load the necessary libraries
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.svm import SVC
  
# Load the iris dataset
df = pd.read_csv('iris.csv')
  
# Split the data into features and labels
X = df[['sepal_length', 'sepal_width', 'petal_length', 'petal_width']]
y = df['species']
  
# Split the data into training and testing sets
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
  
# Create an SVM model and train it
model = SVC()
model.fit(X_train, y_train)
  
# Evaluate the model on the test data
accuracy = model.score(X_test, y_test)
  
print('Test accuracy:', accuracy)


output:

Test accuracy: 0.9666666666666667
 

 Related Articles:

References:

This blog is contributed by Nikhil Kumar.



Similar Reads

How Should a Machine Learning Beginner Get Started on Kaggle?
Are you fascinated by Data Science? Do you think Machine Learning is fun? Do you want to learn more about these fields but aren’t sure where to start? Well, start with Kaggle! Kaggle is an online community devoted to Data Scientist and Machine Learning founded by Google in 2010. It is the largest data community in the world with members ranging fro
8 min read
Support vector machine in Machine Learning
In this article, we are going to discuss the support vector machine in machine learning. We will also cover the advantages and disadvantages and application for the same. Let's discuss them one by one. Support Vector Machines : Support vector machine is a supervised learning system and is used for classification and regression problems. Support vec
9 min read
Azure Virtual Machine for Machine Learning
Prerequisites: About Microsoft Azure, Cloud Based Services Some of the Machine Learning and Deep Learning algorithms may require high computation power which may not be supported by your local machine or laptop. In that case, creating a Virtual Machine on a cloud platform can provide you the expected computation power. We can have a system with hig
4 min read
Machine Learning Model with Teachable Machine
Teachable Machine is a web-based tool developed by Google that allows users to train their own machine learning models without any coding experience. It uses a web camera to gather images or videos, and then uses those images to train a machine learning model. The user can then use the model to classify new images or videos. The process of creating
7 min read
Artificial intelligence vs Machine Learning vs Deep Learning
Nowadays many misconceptions are there related to the words machine learning, deep learning, and artificial intelligence (AI), most people think all these things are the same whenever they hear the word AI, they directly relate that word to machine learning or vice versa, well yes, these things are related to each other but not the same. Let's see
4 min read
Need of Data Structures and Algorithms for Deep Learning and Machine Learning
Deep Learning is a field that is heavily based on Mathematics and you need to have a good understanding of Data Structures and Algorithms to solve the mathematical problems optimally. Data Structures and Algorithms can be used to determine how a problem is represented internally or how the actual storage pattern works & what is happening under
6 min read
Machine Learning - Learning VS Designing
In this article, we will learn about Learning and Designing and what are the main differences between them. In Machine learning, the term learning refers to any process by which a system improves performance by using experience and past data. It is kind of an iterative process and every time the system gets improved though one may not see a drastic
3 min read
Passive and Active learning in Machine Learning
Machine learning is a subfield of artificial intelligence that deals with the creation of algorithms that can learn and improve themselves without explicit programming. One of the most critical factors that contribute to the success of a machine learning model is the quality and quantity of data used to train it. Passive learning and active learnin
3 min read
Automated Machine Learning for Supervised Learning using R
Automated Machine Learning (AutoML) is an approach that aims to automate various stages of the machine learning process, making it easier for users with limited machine learning expertise to build high-performing models. AutoML is particularly useful in supervised learning, where you have labeled data and want to create models that can make predict
8 min read
Meta-Learning in Machine Learning
Traditional machine learning requires a huge dataset that is specific to a particular task and wishes to train a model for regression or classification purposes using these datasets. That’s radically far from how humans take advantage of their past experiences to learn quickly a new task from only a handset of examples. What is Meta Learning?Meta-l
13 min read
Continual Learning in Machine Learning
As we know Machine Learning (ML) is a subfield of artificial intelligence that specializes in growing algorithms that learn from statistics and make predictions or choices without being explicitly programmed. It has revolutionized many industries by permitting computer systems to understand styles, make tips, and perform tasks that were soon consid
10 min read
Few-shot learning in Machine Learning
What is a Few-shot learning?Few-shot learning is a type of meta-learning process. It is a process in which a model possesses the capability to autonomously acquire knowledge and improve its performance through self-learning. It is a process like teaching the model to recognize things or do tasks, but instead of overwhelming it with a lot of example
8 min read
What Is Meta-Learning in Machine Learning in R
In traditional machine learning, models are typically trained on a specific dataset for a specific task, and their performance is optimized for that particular task. However, in R Programming Language the focus is on building models that can leverage prior knowledge or experience to quickly adapt to new tasks with minimal additional training data.
7 min read
Types of Federated Learning in Machine Learning
Federated Learning is a powerful technique that allow a single machine to learn from many different source and converting the data into small pieces sending them to different Federated Learning (FL) is a decentralized of the machine learning paradigm that can enables to model training across various devices while preserving your data the data priva
5 min read
Machine Learning-based Recommendation Systems for E-learning
In today's digital age, e-learning platforms are transforming education by giving students unprecedented access to a wide range of courses and resources. Machine learning-based recommendation systems have emerged as critical tools for effectively navigating this vast amount of content. The article delves into the role of recommendation systems in e
9 min read
Understanding PAC Learning: Theoretical Foundations and Practical Applications in Machine Learning
In the vast landscape of machine learning, understanding how algorithms learn from data is crucial. Probably Approximately Correct (PAC) learning stands as a cornerstone theory, offering insights into the fundamental question of how much data is needed for learning algorithms to reliably generalize to unseen instances. PAC learning provides a theor
8 min read
One Shot Learning in Machine Learning
One-shot learning is a machine learning paradigm aiming to recognize objects or patterns from a limited number of training examples, often just a single instance. Traditional machine learning models typically require large amounts of labeled data for high performance. Still, one-shot learning seeks to overcome this limitation by enabling models to
7 min read
Difference Between Artificial Intelligence vs Machine Learning vs Deep Learning
Artificial Intelligence is basically the mechanism to incorporate human intelligence into machines through a set of rules(algorithm). AI is a combination of two words: "Artificial" meaning something made by humans or non-natural things and "Intelligence" meaning the ability to understand or think accordingly. Another definition could be that "AI is
14 min read
Difference Between Machine Learning and Deep Learning
If you are interested in building your career in the IT industry then you must have come across the term Data Science which is a booming field in terms of technologies and job availability as well. In this article, we will explore the Difference between Machine Learning and Deep Learning, two major fields within Data Science. Understanding these di
8 min read
7 Steps to Getting Started With IoT
Ever been amazed by the technology that gets your coffee ready even before you wake up? Or that sets your alarm clock according to the traffic and weather conditions? Do you want to get a better look and create one of these technologies yourself? If the answer to any of the above questions was yes, then you are in the right place. Let's dive into t
4 min read
Getting started with the Google Coral USB accelerator
In this article, you'll be guided through setting up and running your first machine learning model on your RaspberryPi using the Google Coral USB accelerator. What is it? The Coral USB Accelerator is a USB device that provides an Edge TPU as a coprocessor for your computer. It allows the user to run inferencing of the pre-trained TensorFlow Lite mo
4 min read
ML | Getting Started With AlexNet
This article is focused on providing an introduction to the AlexNet architecture. Its name comes from one of the leading authors of the AlexNet paper- Alex Krizhevsky. It won the ImageNet Large Scale Visual Recognition Challenge (ILSVRC) 2012 with a top-5 error rate of 15.3% (beating the runner up which had a top-5 error rate of 26.2%). The most im
3 min read
Getting started with Python for Automated Trading
Automated Trading is the terminology given to trade entries and exits that are processed and executed via a computer. Automated trading has certain advantages: Minimizes human intervention: Automated trading systems eliminate emotions during trading. Traders usually have an easier time sticking to the strategy by holding emotions in check. Backtest
3 min read
Getting started with Dialogflow
Dialogflow (formerly known as Api.ai), is the platform owned by Google to build conversational agents. Instead of building a chatbot from scratch, Dialogflow makes it easier to build it in considerably less time and with bunch of Google features, including pre-build ML Models that can help you get started right away. Dialogflow also allows you to i
4 min read
Getting Started with Google Actions
Actions on Google is the developer platform for the Google Assistant. By creating actions, brands are able to bring their services to the Google Assistant. Some important terms related to Actions on Google: Actions An interaction with the to start a conversation, the user needs to invoke your Action through the Assistant. Users say or type a phrase
4 min read
Getting Started with iOS Development
In recent years, the mobile app market has seen exponential growth, and there are now millions of apps available for download on both the iOS and Android operating systems. Because of this, businesses require developers that can produce attractive, high-quality apps that stand out in the crowded app market. One of the most coveted among all is iOS
9 min read
Getting Started With ChatGPT: A Complete Guide With Examples
Artificial Intelligence (AI) has brought about a significant transformation in the software industry and its technologies, revolutionizing the business landscape. Chatbots are one of the types of AI-powered platforms that mimic human-like conversation. Among these platforms, ChatGPT is a powerful tool that has quickly gained popularity on the inter
15+ min read
Getting Started With Google Colab
Google Colab is the short form for "Google Colabortory". It is an executable document that lets you write, run, and share code or you can think as an improved version of "Jupyter Notebook" stored in Google Drive. You might be wondering about the word "Notebook", in simple words it is just a document that includes executable lines of code along with
6 min read
Contributing to Open Source : Getting Started
Open-source software is software that is freely available to use, redistribute, and modify. Open source software is already integrated into our daily lives, even more if you are working with IT. A recent research about open source usage shows that 66% of companies will first look for open source solutions before considering any other options. Many
4 min read
MongoDB: Getting Started
Introduction to MongoDB Terminologies: A MongoDB Database can be called as the container for all the collections. Collection is a bunch of MongoDB documents. It is similar to tables in RDBMS.Document is made of fields. It is similar to a tuple in RDBMS, but it has dynamic schema here. Documents of the same collection need not have the same set of f
5 min read
Practice Tags :