think machine learning with scikit-learn (python)

89
Think Machine Learning with Scikit-learn (Python) By: Chetan Khatri Principal Big Data Engineer, Nazara Technologies. ata Science Lab, The Department of Computer Science, University of Kachchh

Upload: chetan-khatri

Post on 18-Jan-2017

117 views

Category:

Data & Analytics


5 download

TRANSCRIPT

Page 1: Think Machine Learning with Scikit-Learn (Python)

Think Machine Learning with Scikit-learn (Python)

By: Chetan KhatriPrincipal Big Data Engineer, Nazara Technologies.

Data Science Lab, The Department of Computer Science, University of Kachchh.

Page 2: Think Machine Learning with Scikit-Learn (Python)

About mel - Principal Big Data Engineer, Nazara Technologies.l - Technical Reviewer – Packt Publication.l - Ex. Developer - Eccella Corporation.l Alumni, The Department of Computer Science, KSKV

Kachchh University.

Page 3: Think Machine Learning with Scikit-Learn (Python)

Outline

l An Introduction to Machine Learningl Hello World in Machine learning with 6 lines of code

l Visualizing a Decision Treel Classifying Imagesl Supervised learning : Pipelinel Writing first Classifier

Page 4: Think Machine Learning with Scikit-Learn (Python)

Early Days AI Programs : Deep Blue

Page 5: Think Machine Learning with Scikit-Learn (Python)

Now, AI Programs

l Alpha go is best example, wrote for Playing Go game, but it can play Atari games also.

Page 6: Think Machine Learning with Scikit-Learn (Python)

Machine Learning

l Machine Learning does this possible, it is study of algorithms which learns from examples and experience having set of rules and hard coded lines.

l “Learns from Examples and Experience”

Page 7: Think Machine Learning with Scikit-Learn (Python)

Let's have problem

l Let's have problem: It seems easy but difficult to solve without machine learning.

Page 8: Think Machine Learning with Scikit-Learn (Python)

Open Source Libraries

Page 9: Think Machine Learning with Scikit-Learn (Python)
Page 10: Think Machine Learning with Scikit-Learn (Python)
Page 11: Think Machine Learning with Scikit-Learn (Python)
Page 12: Think Machine Learning with Scikit-Learn (Python)
Page 13: Think Machine Learning with Scikit-Learn (Python)

Classifier

Page 14: Think Machine Learning with Scikit-Learn (Python)

Scikit-learn

Page 15: Think Machine Learning with Scikit-Learn (Python)

Test ! No error ! Yay !!

Page 16: Think Machine Learning with Scikit-Learn (Python)

Supervised Learning

Collecting Training

Data

Train Classifier

MakePredictions

Page 17: Think Machine Learning with Scikit-Learn (Python)

Training DataWeight Texture Label150g Bumpy Orange170g Bumpy Orange140g Smooth Apple130g Smooth Apple

Features

Examples

Page 18: Think Machine Learning with Scikit-Learn (Python)
Page 19: Think Machine Learning with Scikit-Learn (Python)
Page 20: Think Machine Learning with Scikit-Learn (Python)
Page 21: Think Machine Learning with Scikit-Learn (Python)
Page 22: Think Machine Learning with Scikit-Learn (Python)
Page 23: Think Machine Learning with Scikit-Learn (Python)
Page 24: Think Machine Learning with Scikit-Learn (Python)
Page 25: Think Machine Learning with Scikit-Learn (Python)
Page 26: Think Machine Learning with Scikit-Learn (Python)

Training Data

Page 27: Think Machine Learning with Scikit-Learn (Python)

Important Concepts

l How does this work in Real world ?l How much training data do you need ?l How is the tree created ?l What makes a good feature ?

Page 28: Think Machine Learning with Scikit-Learn (Python)

Many Types of Classifier

l Artificial Neural Network (ANN)l Support Vector Machine (SVM)l Nearest Neighbour classifier (KNN)l Random Forest (RF)l Gradient Boosting Machine (GBM)l Etc..l Etc..

Page 29: Think Machine Learning with Scikit-Learn (Python)

Demo

Page 30: Think Machine Learning with Scikit-Learn (Python)

2. Visualizing a Decision Tree

Page 31: Think Machine Learning with Scikit-Learn (Python)

3. What Makes a Good Feature?

l Imagine we want to write classifier to classify two types of dogs.

Page 32: Think Machine Learning with Scikit-Learn (Python)
Page 33: Think Machine Learning with Scikit-Learn (Python)
Page 34: Think Machine Learning with Scikit-Learn (Python)

Variation in the world !

Page 35: Think Machine Learning with Scikit-Learn (Python)

l Hands - On

Page 36: Think Machine Learning with Scikit-Learn (Python)
Page 37: Think Machine Learning with Scikit-Learn (Python)

About 80% of dogs at this height are labs

Page 38: Think Machine Learning with Scikit-Learn (Python)

About 95% of dogs at this height are greyhounds

Page 39: Think Machine Learning with Scikit-Learn (Python)

l Feature captures different types of information

Page 40: Think Machine Learning with Scikit-Learn (Python)

Thought Experiment

Page 41: Think Machine Learning with Scikit-Learn (Python)
Page 42: Think Machine Learning with Scikit-Learn (Python)
Page 43: Think Machine Learning with Scikit-Learn (Python)
Page 44: Think Machine Learning with Scikit-Learn (Python)
Page 45: Think Machine Learning with Scikit-Learn (Python)
Page 46: Think Machine Learning with Scikit-Learn (Python)

Avoid useless features

Page 47: Think Machine Learning with Scikit-Learn (Python)

Independent features are best

Page 48: Think Machine Learning with Scikit-Learn (Python)

l Height in Inchesl Height in centimeters

Page 49: Think Machine Learning with Scikit-Learn (Python)

l Height in Inchesl Height in centimeters

Page 50: Think Machine Learning with Scikit-Learn (Python)

l Avoid Redundant featuresl Feature should be easy to understand

Page 51: Think Machine Learning with Scikit-Learn (Python)
Page 52: Think Machine Learning with Scikit-Learn (Python)
Page 53: Think Machine Learning with Scikit-Learn (Python)
Page 54: Think Machine Learning with Scikit-Learn (Python)

l Simpler relationships are easier to learn.l Ideal features are:

l Informativel Independentl Simple

Page 55: Think Machine Learning with Scikit-Learn (Python)

4. Pipeline - Machine Learning

Page 56: Think Machine Learning with Scikit-Learn (Python)
Page 57: Think Machine Learning with Scikit-Learn (Python)
Page 58: Think Machine Learning with Scikit-Learn (Python)
Page 59: Think Machine Learning with Scikit-Learn (Python)
Page 60: Think Machine Learning with Scikit-Learn (Python)
Page 61: Think Machine Learning with Scikit-Learn (Python)
Page 62: Think Machine Learning with Scikit-Learn (Python)
Page 63: Think Machine Learning with Scikit-Learn (Python)
Page 64: Think Machine Learning with Scikit-Learn (Python)
Page 65: Think Machine Learning with Scikit-Learn (Python)
Page 66: Think Machine Learning with Scikit-Learn (Python)
Page 67: Think Machine Learning with Scikit-Learn (Python)
Page 68: Think Machine Learning with Scikit-Learn (Python)
Page 69: Think Machine Learning with Scikit-Learn (Python)
Page 70: Think Machine Learning with Scikit-Learn (Python)
Page 71: Think Machine Learning with Scikit-Learn (Python)
Page 72: Think Machine Learning with Scikit-Learn (Python)
Page 73: Think Machine Learning with Scikit-Learn (Python)

l http://playground.tensorflow.org/

Page 74: Think Machine Learning with Scikit-Learn (Python)

5. Writing our first classifier

Page 75: Think Machine Learning with Scikit-Learn (Python)
Page 76: Think Machine Learning with Scikit-Learn (Python)
Page 77: Think Machine Learning with Scikit-Learn (Python)
Page 78: Think Machine Learning with Scikit-Learn (Python)
Page 79: Think Machine Learning with Scikit-Learn (Python)
Page 80: Think Machine Learning with Scikit-Learn (Python)
Page 81: Think Machine Learning with Scikit-Learn (Python)

l Measure Distance

Page 82: Think Machine Learning with Scikit-Learn (Python)
Page 83: Think Machine Learning with Scikit-Learn (Python)
Page 84: Think Machine Learning with Scikit-Learn (Python)
Page 85: Think Machine Learning with Scikit-Learn (Python)

Demo

l Implement nearest neighbor Algorithm

Page 86: Think Machine Learning with Scikit-Learn (Python)

Next Step

Page 87: Think Machine Learning with Scikit-Learn (Python)
Page 88: Think Machine Learning with Scikit-Learn (Python)
Page 89: Think Machine Learning with Scikit-Learn (Python)

Thank you