Zero to Hero
in
Machine Learning
Part1
Ravindu Ramesh Perera
Copyrights 2020 Ravindu Ramesh Perera
All rights reserved
About the Author
Ravindu Ramesh Perera is a Software Engineer at theAITeam (https://the-ai.team ), an Expert Volunteer in STEMUp Educational Foundation and the Micro:bitSLUG program leader.
He is a computer science undergraduate at the University of Colombo School of Computing and currently doing researches under Natural Language Processing topic. He has delivered sessions on various topics in various events in Sri Lanka and has published several articles and tutorials in his blog and in his YouTube channel too.
More info - https://ravinduramesh.blogspot.com
Dedication
To my parents and my colleagues who encouraged and helped me to write this book
Contents
What is Machine Learning 1 4
History of AI & ML 5 8
Machine Learning Types 9 13
Machine Learning Algorithms 14 24
Jupyter Notebook for ML 25 28
Working with Images 29 40
Process of Machine Learning 41 51
Lets Train a Machine 52 61
Summarizing 62 - 64
What is Machine Learning
Can you tell the name of the animal shown in the picture below?
I think you dont know its name. Its ok. Now look at the pictures below
Above 3 pictures contain an animal called Sloth.
Now can you tell the name of the animal in the picture below?
Yes of course. Now you know that the above picture contains a Sloth because you learned it with 3 different examples. Thats how normally a human learns. But how does a machine learn new things? Its exactly the same way. In machine learning, we have to give a collection of examples to the machine. If we input a collection of Sloths images to the computer and define an algorithm to learn by those images, the machine would tell us whether its a Sloths image or not after inputting a different image.
Algorithm - A step by step procedure or set of rules to be followed to solve a specific problem
Machine Learning is the ability of a computer program or a machine to learn through provided data and think by itself without being explicitly programmed. It is an application of AI (Artificial Intelligence)
We should give the machine a set of examples to learn from them. Then we can request outputs from the machine.
The machine knows its a cat because the machine has learned from previous data (images).
The machine doesn't know its a dog because the machine has never seen a dog before. But the machine knows what a cat looks like. So that machine can say its not a cat for sure.
History of AI & ML
In 1950, Alan Turing published Computing Machinery and Intelligence paper, in which he asked: Can machines think?. Alan Turing creates the Turing Test to determine if a computer has real intelligence. To pass the test, a computer must be able to fool a human into believing it is also a human.
During the test, one of the humans works as the evaluator, while the second human and the computer work as respondents. The evaluator cant see the respondents. The evaluator asks the respondents some questions. Then the evaluator is asked to decide which respondent was human and which was a computer.
The test is repeated many times. If the evaluator determines which one is the human in half of the test runs or less, the computer is considered artificially intelligent because the evaluator has considered it as a human in half of the test runs or more.
Alan Turins Turing Test concept is used in CAPTCHA, which is a type of challenge-response test used in computing to determine whether the user is a human.
In 1952 Arthur Samuel wrote the first computer learning program. The program was the game of checkers, and the IBM computer improved at the game the more it played, studying which moves made up winning strategies and incorporating those moves into its program.
In 1957, Frank Rosenblatt designed the first neural network for computers, which simulates the thought processes of the human brain.
In the 1990s, Scientists began creating programs for computers to analyze large amounts of data and learn from the results.
In 1997, IBMs Deep Blue (a well known AI project) beats the world champion at chess.
In 2011, IBMs Watson (another well known AI project) beat its human competitors at Jeopardy.
In 2015, Microsoft created the Distributed Machine Learning Toolkit, which enables the efficient distribution of machine learning problems across multiple computers.
In 2015 Google released TensorFlow, which is a library developed by the Google Brain Team to accelerate machine learning and deep neural network research.
Machine Learning Types
We can categorize the machine learning domain into 4 main sub-categories.