Getting started with Machine Learning
Tags: ai, machinelearning
Published: 2020-03-13 19:10:49

Artificial Intelligence, Machine Learning and Deep Learning are some of the hottest topics right now and have been experiencing an explosion in popularity and usage.  However there are a lot of unfamiliar terms and subject materials to delve into and it can be hard to figure out where to start.  The first step in getting started can be the most difficult to take and when given too many choices in terms of direction it can often be crippling.  This article will cover some basic terms and offer curated resources to further your learning.  The underlying assumption of this article is that you are not an expert in machine learning or python and need a foundation in these subjects.

## What is machine learning?

Machine learning is a system that can learn from example through self-improvement and without being explicitly coded for.  The main idea is that a machine can learn from the data to produce accurate results.  Machine learning typically combines data with statistical tools to predict an output.  Machine learning is closely related to data mining and Bayesian predictive modeling.  The machine receives data as input and uses an algorithm to come up with answers.  You should note that Machine learning is different from Artificial Intelligence and Deep Learning, even though the terms are sometimes used interchangeably by people who don’t know better.

### Types of learning
Machine learning can be grouped into three broad learning methods
Supervised Learning: Regression and Classification
Unsupervised Learning: Clustering and Dimensionality Reduction
Reinforcement Learning: Real time decisions, Game AI, Navigation, Skill Acquisition

#### Supervised Learning
An algorithm uses training data and feedback from humans to learn the relationship of given inputs to an output.  You can use supervised learning when the output data is known. The algorithm will predict or label new data once trained.  

There are two main categories of supervised learning:
##### Classification task: An example would be identifying the gender of a customer based on sales or other information gathered about the customer.  A classifier is not limited to just two classes, just about any number is possible.
##### Regression task: When the data output is a continuous value it falls into the regression category.  For instance, a financial analyst may need to forecast the value of a stock based on a range of features such as equity, previous performance, and macroeconomics indexes. The system will be trained to estimate the price of the stocks with the lowest possible error.

#### Unsupervised Learning
Unsupervised learning is quite different from supervised in the sense that it almost always does not have a definite output. The learning agent aims to find structures or patterns in the data.  You can use it when you do not know how to classify the data, and you want the algorithm to find patterns and classify the data for you

#### Reinforcement Learning
Reinforcement learning is where the learner receives rewards and punishments for its actions. The reward could simply be a score and the agent could be told to receive as much score as possible in order to “win”.

## Challenges and Limitations of Machine learning
The primary challenge of machine learning is the lack of data or the diversity in the dataset. A machine cannot learn if there is no data available. A dataset also needs to be diverse enough to give meaningful insight. It is rare that an algorithm can extract information when there are no or few variations. It is recommended to have at least 20 observations per group to help the machine learn.  This need for data is why data is referred to as the new oil.

## How to start learning Machine Learning?
While a Ph.D. degree is not necessary, you do need at least a basic understanding of some of the math behind machine learning.  Without this understanding you will not be able to feed your algorithms meaningful data.

#### Some basic prerequisites:
1. Learn Linear Algebra, Multivariate Calculus, and Probability Theory: All are very important in Machine Learning, though the extent to which you’ll need them depends on how much you want to focus on R&D vs using available libraries.  Even if you plan on using existing libraries you will want at least a basic understanding of Linear Algebra, Multivariate Calculus and Probability Theory.
2. Learn Statistics: Data plays the most important role in Machine Learning.  A lot of your time will be spent collecting and cleaning data and since statistics is the field that handles collection, analysis and presentation of data you’ll want a solid foundation in it.
3. Learn Python: Python has become the standard language for using many of the tools in Machine Learning.  While there are other possibilities such as R and Scala, Python is by far the most popular.  Some of the most important Python libraries for Artificial Intelligence and Machine Learning are [Keras](https://keras.io/), [TensorFlow](https://www.tensorflow.org/), and [Scikit-learn.](https://scikit-learn.org/stable/)

Some of these prerequisites are covered in the resources below, but you may need to find some other resources to fill in any missing gaps in your knowledge.

### Resources for Learning Machine Learning
#### Recommended readings:
An excellent book that introduces many Supervised and Unsupervised Learning algorithms and methods: [*Elements of Statistical Learning*](http://statweb.stanford.edu/~tibs/ElemStatLearn/printings/ESLII_print10.pdf)

If you find *Elements of Statistical Learning* beyond your ability to start on right away, you can try starting with [*An Introduction to Statistical Learning*]
(http://faculty.marshall.usc.edu/gareth-james/ISL/ISLR%20Seventh%20Printing.pdf)
Videos with labs can be found [here.](https://www.r-bloggers.com/in-depth-introduction-to-machine-learning-in-15-hours-of-expert-videos/)

An excellent book for hands on learning after you have mastered some basic concepts: *Hands-On Machine Learning with Scikit-Learn and TensorFlow: Concepts, Tools, and Techniques to Build Intelligent Systems* by Aurélien Géron

For those interested in Deep Learning: [*The Deep Learning Book*](https://www.deeplearningbook.org/front_matter.pdf) is an excellent free resource.  You can even find virtual study groups to go through the book together.

#### Recommended courses:
Even though it is getting up there in age and the course uses Octave instead of Python I highly recommend [Andrew Ng's Coursera Course](https://www.coursera.org/learn/machine-learning/home/info). 

Another option is [Udacity’s Intro to Machine Learning with PyTorch.](https://www.udacity.com/course/intro-to-machine-learning-nanodegree--nd229)

If you chose Andrew Ng’s course, I do recommend re-implementing all the solutions in Python after doing them in Octave and making sure you get the same answers.

If you have basic python skills and an interest in deep learning, another option is the Winter 2016 CS231n course from Stanford.  The [lectures](https://www.youtube.com/playlist?list=PLkt2uSq6rBVctENoVBg1TpCC7OQi31AlC) are top notch and the [course notes](http://cs231n.github.io/) are incredibly detailed.  The homework assignments really reinforce the lessons. It goes from traditional statistical machine learning methods to convolutional neural net, and recurrent neural net. And it is recent enough for everything that gets taught to be for the mostly relevant.

#### For Fun and Resume Filler:
[Kaggle](https://www.kaggle.com) Competitions

Kaggle competitions are a great way to become more proficient in Machine Learning by combining theoretical knowledge with practical implementation in an easy to do format.  Two of the better basic competitions you can do are Kaggle are:

[Titanic: Machine Learning from Disaster:](https://www.kaggle.com/c/titanic)
The Titanic: Machine Learning from Disaster challenge is a very popular beginner project for Machine Learning and has multiple tutorials available. It is a great introduction to concepts such as data exploration, feature engineering, and model tuning.

[Digit Recognizer:](https://www.kaggle.com/c/digit-recognizer) 
The Digit Recognizer is a good project to attempt after you have some knowledge of Python and Machine Learning basics. It is a great introduction into the exciting world neural networks using a classic dataset which includes pre-extracted features.

#### More Resources:
A website that does a great job breaking down the steps you need to learn machine learning including a lot of useful resources can be found here: https://machinelearningmastery.com/start-here/#getstarted

## Summary
So we covered the very basics of Machine Learning and went over some resources to continue learning more.  Like any science the amount of information to learn and understand can feel overwhelming.  The resources you choose can make the task seem a lot less daunting, which is why I tried to list a variety covering a range of knowledge and different backgrounds.  Pick one that seems right for you and give it a try!
<a href="https://dev.to/leading-edje">
  ![Smart EDJE Image](https://dev-to-uploads.s3.amazonaws.com/i/5uo60qforg9yqdpgzncq.png)
<a/>