Complete Machine Learning Guide — 2023
Welcome to the complete Machine Learning Guide in 2023. In this article, I am talking about how to use data and build your own machine learning model (
not scratch ). After reading this article you are able to understand this field completely. This is our promise.
Keep reading 🔥
Today machine learning is a very trending📈 topic, news articles, videos, and podcasts everyone talks about in this existing field. Every year a new documentary movie comes to AI related. And one slogan is very popular today
[Artificial Intelligence Replace Human Job]. But after completing this article, you understand, Why learning AI is the best investment in your career in the 21st century.
What Is Artificial Intelligence, Machine learning, And Data Science
Many people are confused about these three topics. And so this is the most common question on the internet.
The first time I learned machine learning, did the same thing happen to me? I searched google for this question and found so many answers thanks to the internet. These three topics are hard to understand at first because there is no formal definition. Even after being a long-time Artificial intelligence researcher, I don’t have an easy answer to this question.
But I will explain this question in an easy way so you can understand it better.
What Is Machine learning
Machine learning is a process of finding patterns in data and predicting some kind of feature event. I know you don’t understand, this is the first time it’s not a problem. Let’s understand one by one.
Suppose you have data
( example: 1000 dog or 1000 cat images ) and your dream is to build one application to predict the right animal 🐘🦒name. So you can turn your data into a machine learning algorithm. This time your machine learning algorithm finds patterns in this data of what a dog or cat looks like. Your machine-learning algorithm learns this data. So next time your application sees dog or cat images they can tell what is the animal’s name. I assume you understand what machine learning is, if you don’t understand don’t problem I will explain later.
Best Definition Of Artificial Intelligence
And now this is the next confusing question is the internet? Machine learning is a subfield of Artificial intelligence (AI) but the question is what is AI? Before AI, first understand the human brain. We are human the most intelligent on the planet, because of our brain. In one sentence Artificial Intelligence learns from data and predicting features.
But AI is more powerful than humans, is my belief.
Artificial intelligence was born in 1956 in a summer camp. Asking some questions to computer scientists — how computer think? This one question changes the technology world. The same question today asked every AI practitioner.
Simple Differences Between Data Science, Machine Learning, and Artificial Intelligence
Many people, including myself, are confused about the same words data science or machine learning same. The answer is not 100% but 89% percent is the same. Try to understand real life examples of what one machine learning and data science engineering job is everyday.
Suppose you have a data science engineer in Apple company. Your job is to clean the data (remove the duplicate things, remove unnecessary columns and rows). It simply means your job is to prepare data clean so a company can use this data and make a decision.
The same example is opposite 👨🏻💻👩🏻💻
Machine learning engineers collect data, clean data, and build models (applications).
One difference between data science and machine learning engineer — data science engineer is all about data-related work ( data cleaning, data processing, data preparation, data collection, and more ) while machine learning engineer is all about creating models. Some examples are (Self-driving car, speech recognition -Alexa, Chatbot – ChatGPT more )
Let’s now learn how to build a Machine Learning model.
6 Steps For Every Machine Learning Project in Your Future.
Every machine learning project pipeline has three major steps: data collection, data modeling, and deployment all influence one another. If you miss one, your machine learning project is not complete. So please read carefully and understand first. If you have any problem don’t waste your time just ask, every second is important in your life.
Let’s now build your first machine learning project. So you collect data & build a model. You realize the data you collected was poor, go back to collected data, model it again finds a good model, and again deploy it. This is a cycle for every machine learning project
Let me know if your question is what the model means? what is the meaning of deployment and how do I collect data for machine learning projects?
This is an excellent question in your mind. One thing remembers learning time every question matters. The more questions we have, the more you know.
How you collect data depends on your machine learning problem. Let’s understand below example.
Example 👜 — All data collected from Amazon, their customers, some of the which thing they buy or not , which thing they like or not, everything based on their past and present experience. Then build a machine learning model.
What Is The Difference Between Algorithms and Machine learning Algorithms
This is a very interesting question in the computer science community. So in this question I will explain in a very fun way so you don’t forget this two difference.
Example 💡— Let’s say you build a cooking application that provides the best chicken dish recipe.
How does a normal algorithm work?👇
Input ( Rule )
First, cut the chicken into small pieces.
Clean chicken and cut vegetables
Fry vegetables 🥕
Add butter🧈 and spicey tomato ketchup🍅
How much time⏳ do I need to prepare this dish? And so on …
How many chickens 🐔need.
How much chili, sugar, tomato, and other vegetables need?
Output ( Answer )
- What does the chicken look like after it is ready and what is the taste of eating this food?
You notice 💡: everything defines you – this is called classical programming.
Same example but this time machine learning method.
Machine learning 🔥: Data + Output (Answer ) = Input ( Rule )
You have a lot of data on how to cook a chicken dish. And you know what it looks like when your output will be. So your job is simple.
You provided lots of data on chicken dish recipes and provided the desired output (what looks like a chicken dish recipe). The next step is for your model (algorithms) to learn from data, find pattern data insights and create recipes so people can cook and enjoy. But this time the machine creates rules on its own.
You don’t provide any step-by-step instructions. The machine creates its own instructions.
That is the only difference between normal algorithm and machine learning algorithms. Let’s see another time,
There are many machine learning algorithms. Some algorithms perform better than others, on different problems. But all have the same goal of finding patterns in data and predicting a future event.
In this article, I am focusing on data modeling. I assume you have already collected the data. And you are looking to build a machine learning model. So I am breaking down each step so you can understand it easily.
Step Of Building Machine Learning Model
Let’s understand one by one every step of building machine learning models.
What Machine Learning Problems You Are Solving
Every machine learning engineer mistakes the first time they learn this field. They think solving any problem requires machine learning but this is not true.
First, understand what problem you are trying to solve. Meaning, that you build an application that provides the best chicken dish recipe. And you know how to create this recipe with one single-based rule ( Normal algorithm ). This time don’t use machine learning.
Always remember that not every problem requires machine learning. Sometimes single-based rule ( Normal algorithm ) solved this problem. Ask this question yourself.
What business problem are you trying to solve?
Is this a machine learning problem?
Is This Machine Learning Data
Machine learning is all about data, without data, no exit machine learning. Without data, you don’t build your model. So this is important, first what data do we have? Does this data match our problem definition?
See your data is structured or unstructured? static or streaming? Because machine learning is all about finding patterns and insights into data.
Why Evaluation Is Important in Machine Learning
Asked about this questing? – What is a successful machine learning model? Is 95% accuracy good enough? What is the __% accuracy is good for a machine learning model ready to use in production? Remember that more accuracy is better.
What Are the Features in Machine Learning? and Why it’s Important
Machine learning is all about data, so understanding which data to use to build your machine learning model is important. Not all data is good for building a model.
See below example
Suppose you build an application that predicts user age at present time. Your data is like this.
So, think about which data is important in calculating user age in real-time? If you know it is good to go. Knowing which data is used is very important in building a good model.
In this example, these three features are important in building a model.
Features meaning one sentence machine learning 🔥 : Variable is classical programming. Choosing the right features is important to building a good model. Not all features are good for building models. This example ‘User height & User weight’ does not help you find user age in real-time. So don’t use unnecessary features to build your machine learning project.
What Is Modeling In Machine Learning
This is something many people are confused about what a model is. I know because this is the same thing that happened to me at first on my journey about learning machine learning. In classical programming, you hear the word “Algorithm”. This same word in machine learning is called ‘Model’.
I assume you know what the algorithm means. If you don’t know, not a big problem because not everyone knows anything. So why learning is a very important skill in life.
Simple Definition — What Is Algorithm
If you asked someone or searched. — how do I install WhatsApp on my iPhone? You can find this step by step information.
Open your phone.
On your internet connection
Go to ‘App store’
Searching for WhatsApp
Tap Get – Your “WhatsApp” is installed on your phone
Open WhatsApp – Signup
This step-by-step process is called classical programming algorithm and machine learning term Model. Every model is better than another, but which problem you solve and which model you choose is important. Choosing right model (algorithm) is key.
Machine Learning Model Experimentation 👨🔬
Experimentation is the most important part of every machine learning model, but many people forget this thing. Once they build the model they are ready to go for production. This cause they don’t build a good model — and the company loses money and time.
A good machine learning developer knows that after the model is created, the next step is experimentation again and again. I know this thing takes time and this is extra work. But this is one thing that improves model accuracy and performance. Once your extermination is completely ready, go for production.
Follow the checklist experimentation
How accurate is my model ( it’s 91% or 95% above )
Which model is good for building this model ( algorithm )
Try one of three models ( algorithm )in your building time and check which model is good for accuracy.
Let’s learn real world examples and deep!
What Problems Are You Trying to Solve Using Machine Learning
Remember, not all problems require machine learning. Some problems are solved by rule-based programming ( classical programming ). Always ask this question, is this a problem that needs machine learning? If yes, good to go. The second question is what problem you are trying to solve in business.
Machine learning has many types but in this article, I am writing about four major types of learning mostly used.
What Is Supervised Learning In Machine Learning
Supervised learning is called supervised because you have data and labels.
Label Meaning In Machine Learning
Many people confuse what is the meaning label in machine learning. So in this section I try explain very easy and fun way, so you don’t forget.
It’s an easy way to understand. The label is the target variable.
See image below and answer this question.
Q. Find out which type of patient has heart disease or not? So what is your feature variable? Also, what is your target variable?
Answer ✔ — Your feature variable is ⬇️
Answer ✔ — And your target variable is ⬇️
Q. Let’s understand what is the meaning of supervised learning❓
Supervised learning means you know labels. You provide data in your model ( algorithm ), and they learn data insight and find labels, this is called supervised learning. Supervised learning time you provided data and labels.
Note 🔥 — Supervised learning – Data + Label(Target) = Output
For example, if you have to build a system to predict whether a patient has heart disease or not. So you have to collect anonymized medical patient records and train your model. The model learns this data and sees the label. Once your model is complete. And the next step is — to check the process ( % how accuracy is our model ) :
You pass through the input (a new patient record) and check whether this patient has heart disease or not (output). Supervised time machine learning algorithm learns to see what is labeled ( target variable).
But here is the point: Supervised learning always requires a label ( Target ) which is called supervised learning.
What Is Unsupervised Learning In Machine Learning
If you understand supervised learning — it’s not said in the comment below. Unsupervised learning is learning that you have data but no label (Target). Meaning you have data to build your model but you see this data with no label (Target), which is called unsupervised learning. Some of the examples are— Image prediction, let’s see a real-world example.
Example 🔥: I am using the fruit dataset [ Apple 🍎 and Banana 🍌 ]
I train my model which is apple and banana so next time my model sees apple and banana they predict.
How I am doing it —⬇
I have provided my machine learning algorithm for this fruit dataset. Machine learning algorithms find patterns, insight this data and create labels. See the image below.
My model doesn’t know what it looked like apple🍎 or banana🍌. They divided these images into categories themselves ( mean they learn self ). This divide is called a cluster. Let’s understand how this thing works.
I have a dataset of 1000 images of apples and bananas. The machine is divided into labels, one is apple 🍎and the other is a banana🍌.
Let’s understand this three important concepts below in machine learning ⬇
- Classification — Value is not changing means you predict and classify the problem. In simple terms one is another, that is called classification. Some of the examples are
Email is spam or not ✉️
True or False ✔️
Male or Female 🚹🚺
Regression —If value changes continue, that is called regression. Some of the examples are price, salary, and age.
Yes bank share price – 10.00 Rs (9.30 am ) – 11.01 Rs ( 9.45 am )
Bill Gates Age – 66 Years (2022) 67 Years (2023)
Recommendation — The recommendation’s meaning is very simple. Let’s understand —You have a lot of data in your customer’s previous purchase history or what read on the internet based on the previous history. So you recommended something based on what previous data this user — that is called a recommendation.
Now you know these three meanings, and your next step is to define 💡what business problem you are trying to solve using machine learning.
Remember 🔥 : Not all problems need machine learning, sometimes single-based code instruction rules solve the problem.
In this example, I am using 🚗 Car Insurance Company ( Name is BMW )
BMW is a very big company in the car industry, many people know this. This company sells millions of cars every year. They provide car insurance for their customers.
The company receives thousands of insurance claims per day. Their staff read and decided when sending person claim fault or not.✔✖
The problem is that staff is 30 Thousand and the company receives 1 lakh claims per day, how do we handle this? This is a very big problem for any insurance company, not only car insurance.
The company employer is less and the problem is bigger, how do you handle this type of problem? That is a question asked by the company founder itself.
But the good news is the company has lots of data on the label’s past claims are faulty or not.
Asked this question ❓— Can machine learning help?
I am not telling you the answer? Because you already know the answer. But let’s see. Ask yourself if this problem fits these three options.
What Data Have Working Machine learning Problem
Data is the key to any machine learning project, without data it’s no machine learning exists.
If you build a machine learning project, the first thing you do — Collect data on what problem you are trying to solve. You need the data first🥇.
I guess you already have a data collect — that is great. Let’s see what type of data you collect in a real-world example.
- Structured data — Imagine this row and column. Excel spreadsheet for patient records. See image below for what looks like structured data.
Unstructured data — The data is not a column and row format that is called unstructured data is a short form. Some examples are Images and audio files.
Static data — This type of data has not changed. Some of the examples are your e-commerce website’s customer purchase history. Or in an easy way user date of birth data, that type of data is called static data.
Streaming data — This type of data is constantly changing. Some of the examples are [ Stock market ]. See the example below.
Which Machine Learning Library Need Build Project
If you know everything about what machine learning is, next is how to build your first machine learning project from scratch. So you can solve the problem world.
Best Machine Library And Tool
NumPy ( Numerical computation library )
Pandas (Data Analysis Library)
Scikit learn( Provide machine learning algorithms)
Matplotlib ( Visualization library )
Jupyter Notebook( Run code in a cell )