Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Introduction to Machine Learning, Lecture notes of Introduction to Machine Learning

Introduction to Concepts used in Machine Learning

Typology: Lecture notes

2019/2020
On special offer
30 Points
Discount

Limited-time offer


Uploaded on 07/13/2020

ismail-ouaydah
ismail-ouaydah 🇱🇧

4

(1)

1 document

1 / 39

Toggle sidebar
Discount

On special offer

Related documents


Partial preview of the text

Download Introduction to Machine Learning and more Lecture notes Introduction to Machine Learning in PDF only on Docsity! Prepared by Ismail Ouaydah @ 2018 1 Introduction to Machine Learning Tough concepts made intuitive Prepared by Ismail Ouaydah @ 2018 2 Agenda ● Intro to ML (Machine Learning): – Supervised Learning Use Cases (Regression, Classification) – Unsupervised Learning Use Cases (Clustering & Retrieval, Recommendation, Image recognition with Neural Networks…) – Formalizing an ML Problem – Data Exploration & Preparation: data issues Prepared by Ismail Ouaydah @ 2018 5 Vocabulary ● Input (explanatory variables) & Output (dependent variable or target): data point ● Model ● Training Data (or Learn) ● Features (I.e: size, number of rooms, location…) ● Predict or Score Prepared by Ismail Ouaydah @ 2018 6 Data Science Project Steps 1 - Data Engineering: import raw data explore & visualize preform data cleaning - Machine Learning Feature Selection Model selection Analyze the results - Deployment & Monitoring present your findings take actions Prepared by Ismail Ouaydah @ 2018 7 Defining the right ML problem ● Which type of e-mail is this? Spam or Not => Classification (with Confidence X%) ● How much is this house worth? => Regression ML is used by many companies to get more customers or serve customers better: Amazon (optimize price), Gmail (spam filtering), Zillow (realestate price)…. Prepared by Ismail Ouaydah @ 2018 10 Exploring Data we notice a few things. - There seems to be an outlier with around 800 shares and a little over 5000 likes. This might be an interesting post to investigate. - most of our data are between 0 - 200 shares and 0 - 2000 likes, quite densely actually Prepared by Ismail Ouaydah @ 2018 11 Cleaning Data some of data might not exist. In this case, we have to decide what we should do. There are many valid options: - forget/remove the nonexistent data, - replace it with a default value, - interpolate (for time-series data), etc. In our case, we're just substituting a reasonable value (zero). Prepared by Ismail Ouaydah @ 2018 12 Supervised Learning In supervised learning, we are given a data set and already know what our correct output should look like, having the idea that there is a relationship between the input and the output. - Regression problem...predict results within a continuous output - Classification problem...predict results in a discrete output. Prepared by Ismail Ouaydah @ 2018 15 Use Case2: Sentiment Analysis Prepared by Ismail Ouaydah @ 2018 16 Classification Main Concepts ● Decision Trees ● Confusion Matrix Prepared by Ismail Ouaydah @ 2018 17 Confusion Matrix “Precision”: Fraction of positive predictions that are actually positive What fraction of positive were missed out? “Recall”: Proportion of positive objects that were indeed detected as positive by the model Precision = TP/ (TP+FP) Recall= TP/(TP+FN) Negatives are empty, positives are full Prepared by Ismail Ouaydah @ 2018 20 Use Case4: Product Recommendation Prepared by Ismail Ouaydah @ 2018 21 Use Case5: Visual Product Recommender Prepared by Ismail Ouaydah @ 2018 22 Neural Networks Weighted Inputs OutputProcess Information Connected to other neurons with a little gap called synapse that weights how strongly this input should be considered Perceptrons are the simplest kind of neural networks, they take in an input, weight each input, take the sum of weighted inputs and apply an activation function Prepared by Ismail Ouaydah @ 2018 25 Python Basics ● Jupyter Notebooks: – Interactive webpages served by server, – Contain blocks of text and blocks of code that are editable and runnable – Code is executed on the server by a “kernel” which returns the output (if any), ● Case Sensitive ● Indentation and blocks : ● Data types have methods: – zed=”lower case” – zed.upper() Prepared by Ismail Ouaydah @ 2018 26 Libraries Cheat Sheets - Python Cheat Sheet - Numpy for multi- dimensional arrays - Pandas built on Numpy and provides easy to use data structures - Matplotlib for plotting and visualization Prepared by Ismail Ouaydah @ 2018 27 Online Exercises ● Intro to Python: https://www.kaggle.com/learn/python ● https://colab.research.google.com/notebooks/m lcc/intro_to_pandas.ipynb Prepared by Ismail Ouaydah @ 2018 30 OpenCV Exercise ● Credit Card OCR with Python and OpenCV https://www.pyimagesearch.com/2017/07/17/ credit-card-ocr-with-opencv-and-python/ Prepared by Ismail Ouaydah @ 2018 31 Deep Learning with TensorFlow ● Countless Deep Learning Frameworks… TensorFlow developed by Google Classifiers, Regressors Prepared by Ismail Ouaydah @ 2018 32 Exercise TensorFlow https://colab.research.google.com/notebooks/ mlcc/first_steps_with_tensor_flow.ipynb Prepared by Ismail Ouaydah @ 2018 35 Max Pooling When constructing CNNs, it is common to insert pooling layers after each convolution layer to reduce the spatial size of the representation which reduces the computational complexity Prepared by Ismail Ouaydah @ 2018 36 Activation Functions Hyperbolic Tangent function- Tanh : i f(x) = (1 - exp(-2x)) /( 1 + exp(-2x)) Activation functions are important for a Neural Network to learn and make sense of something really complicated and Non-linear complex functional mappings between the inputs and response variable. They introduce non-linear properties to our Network. Prepared by Ismail Ouaydah @ 2018 37 Keras pre-trained Models Models for image classification with weights trained on ImageNet: ● Xception ● VGG16 ● VGG19 ● ResNet, ResNetV2, ResNeXt ● InceptionV3 ● InceptionResNetV2 ● MobileNet ● MobileNetV2 ● DenseNet ● NASNet