DEV Community

Cover image for Beginning with Machine Learning - Part 1
Apoorva Dave
Apoorva Dave

Posted on • Edited on

Beginning with Machine Learning - Part 1

This question pops into almost everyone’s head who so ever wants to play with this new technology. I myself wondered as to from where should I begin, what should I cover and how can I learn quickly!

I am not here to give you a list of articles from where you can read or explore. But I will help you through it. To have a basic understanding of almost every important concept so that you can dig into that as well. Let’s get started!

  1. What is Machine Learning?
  2. Important types of Machine Learning
  3. Classification Algorithms
  4. Regression Algorithms
  5. Clustering
  6. Cost Functions
  7. Collinearity
  8. PCA
  9. Gradient Descent
  10. Some projects on ML to help you get started

ml1


Image Credits : http://qingkaikong.blogspot.com/2017/04/machine-learning-10-funny-pictures.html

The above list of topics will be covered in almost 5 articles to help you start with ML.

What is Machine Learning?

In ML you learn from data, as simple as that. We don’t have to write any custom code specific to the problem. Instead, we feed data to algorithms and it builds its own logic based on the data.

ml2

Consider you want to identify which fruit is an apple and which is not. You cannot go on writing specific dimensions, color or size of your apple. As each apple might look similar but they don’t have exact same dimensions. This is one of the most basic use cases of ML. Here we will provide the algorithm with all types of apples that is a set of features of different types of apples. Our algorithm learns these features and classifies a fruit as an apple or not an apple!

Types of Machine Learning

ml3
Types of Machine Learning

  1. Supervised: In this approach, we have a labeled dataset. Our model can learn from this labeled data and help in classification, prediction etc. In our above example of apples, when we provide our model with a set of features, each row of the dataset is labeled as to whether those features constitute an apple or not. Classification and Regression problems are supervised.

  2. Unsupervised: Here we have an unlabeled dataset. That is we do not know what all features will constitute an apple. An example is clustering where we cluster or create groups of similar types of objects.

  3. Reinforcement Learning: In this, the agent learns from the environment by interacting with it and receiving rewards for performing actions. It tries to move to a state by performing an action. He learns by receiving a reward for this positive or negative for each action.

Before jumping on to classification and regression algorithms, I will list out a set of terms which will help us have a better understanding.

  1. Model: People often gets confused by the term model. It is simply an artifact that is created by the training process. You provide training data to machine learning algorithms, the data is learned and we get a trained model.

  2. Training and Testing Data: The data provided to the algorithm for learning is called the training set. The predictions are made on a separate dataset called testing data. It is on this data that we check the accuracy of our trained model.

  3. Overfitting and Underfitting: A model is said to be overfitted, if it learns the training data very well, but is unable to generalize. That is even though it gives good results on the trained data it does not provide good predictions on the test data. A model is said to be underfitted if it is unable to learn the training data itself 😄. The underfit model won’t perform well on the seen data forget about the unseen one 😝.

  4. Bias and Variance: Many people (including me) wondered what these errors actually mean. So in simple terms, Bias is the error which occurs because of making wrong assumptions. It results in an underfit model. We might make an assumption that data is linear but in fact, it is quadratic. This causes underfitting. On the other hand, Variance causes overfitting. It is due to the model’s excessive sensitivity to small variations in training data. There is always a trade-off between Bias and Variance. As reducing one error increases the other and vice versa.

There are numerous articles on ML which are better. But here it is an effort to consolidate all the important stuff as I also learn and develop my ML skills. Personally, I prefer using Python and Scikit-Learn. There are other languages and libraries like R, Keras, Tensorflow which we might explore as we go further.

Stay tuned for the next article in the series where we will learn about Regression Algorithms. Till then happy learning! 😃

Top comments (21)

Collapse
 
veselinastaneva profile image
Vesi Staneva

Great post & series! 👏

My team just completed an open-sourced Content Moderation Service built Node.js, TensorFlowJS, and ReactJS that we have been working over the past weeks. We have now released the first part of a series of three tutorials - How to create an NSFW Image Classification REST API and we would love to hear your feedback. Any comments & suggestions are more than welcome. Thanks in advance!
(Fork it on GitHub or click🌟star to support us and stay connected🙌)

Collapse
 
apoorvadave profile image
Apoorva Dave

Sure thing! All the very best!

Collapse
 
veselinastaneva profile image
Vesi Staneva

Thank you! :)

Collapse
 
thomcord profile image
Thomas Cordeiro

Very nice, waiting for the next 😀

Collapse
 
apoorvadave profile image
Apoorva Dave

You can check the series "Beginning with Machine Learning" :) I am planning to write a new article in this series. Do let me know if any of you have anything in mind :) I will write on it if I could!

Collapse
 
thomcord profile image
Thomas Cordeiro

Well, I am very beginner on ML theme, but I will certainly let you know if something (idea or doubt) come up! thank you!

Collapse
 
shahzaibanwar009 profile image
shahzaibanwar009

Thanks Apoorva Dave.
I'm a full stack web dev and i wants you help. Please help me.
I want to learn machine learning how to start i'm not good in math even i have not learn calculus and Linear algebra before.how to get started and how much i should learn about math to get start with machine learning and become a master

Collapse
 
apoorvadave profile image
Apoorva Dave

Hey
So there are two cases - 1. if one has little knowledge of maths, he/she can start with ML concepts and while understanding the algorithm, they can improve maths skills as well. To code, maths might not be needed. But it is always advisable to understand the math behind the algorithm. 2. if one has no prior knowledge of maths, then my suggestion would be to first go through basic maths atleast and then start with ML. Learning maths will not just help you in ML but in other fields of computer science as well.

Collapse
 
mfaghfoory profile image
Meysam Faghfouri

nice post.
please continue it with some practical examples

Collapse
 
apoorvadave profile image
Apoorva Dave

Sure will do. The next two posts will mainly focus on classification and regression concepts after which will give practical examples as well.

Collapse
 
benalidjamel profile image
benali djamel

thank you i like this post <3

Collapse
 
alexoeducative profile image
Alex Ortiz

Spectacular series, Apoorva! How do I get in touch if I have an idea to run by you about it? :)

Collapse
 
apoorvadave profile image
Apoorva Dave

Thank you 😊

Collapse
 
fatimatariq25 profile image
Fatima Tariq

There are numerous article on Machine learning but your article gave me good insights. Looking forward to more such article.

Collapse
 
apoorvadave profile image
Apoorva Dave

Thanks a lot! If you are interested in understanding some other concepts of ML like classification and regression as well then you can check my other posts in this series 😊

Collapse
 
bhupesh profile image
Bhupesh Varshney 👾

Nice 👌 post
Can you please tell me where does Deep Learning fits into the above 3 categories of machine learning ?

Collapse
 
madhadron profile image
Fred Ross

Deep learning refers to neural networks that are much deeper than the three to four layers people were using before. It's interesting because, in order to make it practical at all, you have to use a pretraining step which involves pretending that it's a totally different thing called a restricted Boltzmann machine. That pretraining, if you're lucky, acts as a form of feature extraction and can save feature engineering time.

The initial successes seemed almost magical and everyone leapt on it. It turned out that those successes were very specialized and, while it's a really useful tool, it's not the panacea people thought it might be.

Collapse
 
apoorvadave profile image
Apoorva Dave

You can say Deep learning is the next evolution of machine learning – it’s how machines can make their own accurate decisions without a programmer telling them so.
The types which I have explained in the post are different learning methods which we can use depending on our requirement. If the data is labelled then supervised else unsupervised.

A deep learning model is able to learn through its own method of computing – its own “brain". And for this it uses a layered structure of algorithms called an artificial neural network (ANN).

Collapse
 
bhupesh profile image
Bhupesh Varshney 👾

Ohhh 😲🤤🤤
Well i guess Deep Learning is lit af🔥🔥
Looking forward for your new posts 😀

Collapse
 
meet_zaveri profile image
Meet Zaveri

Gave me good insights! Thanks apoorva

Collapse
 
apoorvadave profile image
Apoorva Dave

Glad that you liked it!