Data Science Weekend Machine Learning Part 2 KMK Online Analytic Team Fajri Koto Data Scientist fajri.koto@kmklabs.com
Machine Learning Part 2 Outline 1. Handling Imbalanced Dataset 2. Understanding the Neural Network 3. Introduction to Deep Neural Network
Machine Learning Part 2 Outline 1. Handling Imbalanced Dataset 2. Understanding the Neural Network 3. Introduction to Deep Neural Network
1. Handling Imbalanced Dataset Introduction
1. Handling Imbalanced Dataset Introduction Example of imbalance The star count is too little!! Ratio (pos vs neg) Ratio = 1 : 95
1. Handling Imbalanced Dataset Introduction Datasets are said to be balanced if there are, approximately, as many positive examples of the concept as there are negative ones. positive + negative -
1. Handling Imbalanced Dataset Introduction There exist many domains that do not have a balanced data set. Examples: Helicopter Gearbox Fault Monitoring Discrimination between Earthquakes and Nuclear Explosions Document Filtering Detection of Oil Spills Detection of Fraudulent Telephone Calls Cancer Keep in mind that, Biasanya model kita berfokus kepada class minor, Contoh: Fraudulence detection, or Cancer detection
1. Handling Imbalanced Dataset Problem of Imbalance Dataset Training stages are often biased towards the majority class. (Generalization) because these classifiers attempt to reduce global quantities such as the error rate, not taking the data distribution into consideration. As a result examples from the overwhelming class are well-classified whereas examples from the minority class tend to be misclassified.
1. Handling Imbalanced Dataset How to tackle imbalance 1. Algorithm Level Ensemble learning 2. Data Level Manipulating data
1. Handling Imbalanced Dataset Tackling Imbalance in Algorithm Level
1. Handling Imbalanced Dataset Tackling Imbalance in Data Level Basic technique: - Random Over Sampling (ROS) Duplicating minority data - Random Under Sampling (RUS) Deleting some majority data
1. Handling Imbalanced Dataset Tackling Imbalance in Data Level (Cont d) The most famous one: SMOTE
1. Handling Imbalanced Dataset SMOTE
1. Handling Imbalanced Dataset How to measure the performances? I have dataset with ratio 90% vs 10% After training, I obtained accuracy 90% Is it good result?
1. Handling Imbalanced Dataset How to measure the performances?
1. Handling Imbalanced Dataset SMOTE
Machine Learning Part 2 Outline 1. Handling Imbalanced Dataset 2. Understanding the Neural Network 3. Introduction to Deep Neural Network
2. Understanding Neural Network Outline 1. 2. 3. 4. 5. 6. What is Neural Network / Artificial Neural Network? Why Neural Network? How Do Neural Networks Work? Example of calculation - the simplest Example of calculation - use backpropagation NN in python
2. Understanding Neural Network 1. What is Artificial Neural Network? VS
2. Understanding Neural Network 1. What is Artificial Neural Network? is a computational system inspired by 1. 2. 3. the Structure Processing Method Learning Ability of a biological brain
2. Understanding Neural Network 1. What is Artificial Neural Network? Realized that the brain could solve many problems much easier than even the best computer image recognition speech recognition pattern recognition Very easy for the brain but very difficult for a computer
2. Understanding Neural Network 1. What is Artificial Neural Network? An extremely simplified model of the brain Essentially a function approximator Transforms inputs into outputs to the best of its ability
2. Understanding Neural Network 1. What is Artificial Neural Network? Composed of many neurons that co-operate to perform the desired function
2. Understanding Neural Network 2. Why Neural Network? - Massive Parallelism - Distributed representation - Learning ability - Generalization ability - Fault tolerance What are they used for? Classification Pattern recognition, feature extraction, image matching Noise Reduction Recognize patterns in the inputs and produce noiseless outputs Prediction Extrapolation based on historical data
2. Understanding Neural Network 2. Why Neural Network? One of successful Implementation of NN
2. Understanding Neural Network 3. How do Neural Network work?
2. Understanding Neural Network 3. How do Neural Network work? #Properties1 : Activation function
2. Understanding Neural Network 3. How do Neural Network work? #Properties1 : Activation function
2. Understanding Neural Network 3. How do Neural Network work? #Properties2 : Weights The weights in a neural network are the most important factor in determining its function Training is the act of presenting the network with some sample data and modifying the weights to better approximate the desired function
2. Understanding Neural Network 3. How do Neural Network work? #Terminology : Epoch Epoch: One iteration through the process of providing the network with an input and updating the network's weights Typically many epochs are required to train the neural network
2. Understanding Neural Network 4. Example of calculation - The simplest
2. Understanding Neural Network 4. Example of calculation - The simplest How does it learn?
2. Understanding Neural Network 4. Example of calculation - Use backpropagation Case: Multi Layer
2. Understanding Neural Network 4. Example of calculation - Use backpropagation
2. Understanding Neural Network 4. Example of calculation - Use backpropagation
2. Understanding Neural Network 4. Example of calculation - Use backpropagation
2. Understanding Neural Network 4. Example of calculation - Use backpropagation
2. Understanding Neural Network 4. Example of calculation - Use backpropagation
2. Understanding Neural Network 4. Example of calculation - Use backpropagation
2. Understanding Neural Network 4. Example of calculation - Use backpropagation Now, For Backpropagation!! Please look at carefully, it is not hard!
2. Understanding Neural Network 4. Example of calculation - Use backpropagation Now, For Backpropagation!! Please look at carefully, it is not hard!
2. Understanding Neural Network 4. Example of calculation - Use backpropagation 1)
2. Understanding Neural Network 4. Example of calculation - Use backpropagation 2)
2. Understanding Neural Network 4. Example of calculation - Use backpropagation 3)
2. Understanding Neural Network 4. Example of calculation - Use backpropagation 4)
2. Understanding Neural Network 5. Neural Network on Sklearn
Machine Learning Part 3 Outline 1. Handling Imbalanced Dataset 2. Understanding the Neural Network 3. Introduction to Deep Neural Network
3. Introduction to Deep Neural Network A Brief Introduction to Deep Learning Artificial Neural Network Back-propagation Fully Connected Layer Convolutional Layer Overfitting
3. Introduction to Deep Neural Network Why do I have to learn deep learning?
3. Introduction to Deep Neural Network Why do I have to learn deep learning?
3. Introduction to Deep Neural Network Why do I have to learn deep learning?
3. Introduction to Deep Neural Network Why do I have to learn deep learning?
3. Introduction to Deep Neural Network Why do I have to learn deep learning?
3. Introduction to Deep Neural Network Why do I have to learn deep learning?
3. Introduction to Deep Neural Network Fully Connected Layer
3. Introduction to Deep Neural Network Convolutional Layer
3. Introduction to Deep Neural Network Convolutional Layer
3. Introduction to Deep Neural Network Fully Connected Layer
Machine Learning Part 1 Thank You Questions? KMK Online Analytic Team Fajri Koto Data Scientist fajri.koto@kmklabs.com