The document discusses decision trees and random forests. It begins with an introduction to decision trees, including how they are used in everyday life to make decisions. It then covers key concepts such as entropy, information gain, and how decision trees use these concepts to build tree structures by recursively splitting nodes based on predictor variables that maximize information gain. The document provides examples to illustrate entropy, information gain, and how they are used to select the root node and build the tree structure.
Dokumen tersebut membahas konsep dasar klasifikasi, yang merupakan proses mengelompokkan data baru ke dalam kelas yang telah ditentukan sebelumnya berdasarkan atribut-atributnya. Diberikan contoh kasus klasifikasi pelanggan untuk menentukan bonus berdasarkan panggilan dan blok. Beberapa teknik klasifikasi dijelaskan seperti menggunakan probabilitas, aturan IF-ELSE, garis keputusan, jarak rata-rata
Linear regression is a statistical method used to analyze and understand the relationship between two or more variables. It predicts a numeric target variable based on one or more independent variables. Single linear regression uses one independent variable to predict the dependent variable based on a linear equation. The document provides examples of calculating linear regression coefficients and making predictions using the linear regression equation. It also discusses evaluating linear regression models using metrics like MAE, MSE, and RMSE.
Dokumen tersebut membahas tentang algoritma Naive Bayes Classifier untuk klasifikasi dan prediksi data. Algoritma ini bekerja dengan menghitung probabilitas kelas berdasarkan pengalaman sebelumnya dengan asumsi independensi antar variabel. Diberikan contoh perhitungan Naive Bayes untuk memprediksi kemungkinan seseorang membeli komputer dan status kelulusannya berdasarkan atribut-atribut tertentu.
The document discusses data preparation and exploratory data analysis. It explains that exploratory data analysis involves exploring a dataset before using it, to understand the data source, data types, attribute names, duplicate rows, missing values, outliers, and univariate, bivariate, and multivariate analyses. This helps ensure the dataset is clean before applying data mining techniques to extract knowledge from the data. The document also provides examples of handling issues like missing values, duplicate rows, and outliers during exploratory data analysis.
Dokumen tersebut memberikan penjelasan mengenai konsep dasar data mining klasifikasi, proses klasifikasi menggunakan algoritma Naive Bayes, serta contoh kasus klasifikasi menggunakan atribut usia, pendapatan, pekerjaan, dan punya deposito atau tidak.
Dokumen tersebut membahas konsep dasar klasifikasi, yang merupakan proses mengelompokkan data baru ke dalam kelas yang telah ditentukan sebelumnya berdasarkan atribut-atributnya. Diberikan contoh kasus klasifikasi pelanggan untuk menentukan bonus berdasarkan panggilan dan blok. Beberapa teknik klasifikasi dijelaskan seperti menggunakan probabilitas, aturan IF-ELSE, garis keputusan, jarak rata-rata
Linear regression is a statistical method used to analyze and understand the relationship between two or more variables. It predicts a numeric target variable based on one or more independent variables. Single linear regression uses one independent variable to predict the dependent variable based on a linear equation. The document provides examples of calculating linear regression coefficients and making predictions using the linear regression equation. It also discusses evaluating linear regression models using metrics like MAE, MSE, and RMSE.
Dokumen tersebut membahas tentang algoritma Naive Bayes Classifier untuk klasifikasi dan prediksi data. Algoritma ini bekerja dengan menghitung probabilitas kelas berdasarkan pengalaman sebelumnya dengan asumsi independensi antar variabel. Diberikan contoh perhitungan Naive Bayes untuk memprediksi kemungkinan seseorang membeli komputer dan status kelulusannya berdasarkan atribut-atribut tertentu.
The document discusses data preparation and exploratory data analysis. It explains that exploratory data analysis involves exploring a dataset before using it, to understand the data source, data types, attribute names, duplicate rows, missing values, outliers, and univariate, bivariate, and multivariate analyses. This helps ensure the dataset is clean before applying data mining techniques to extract knowledge from the data. The document also provides examples of handling issues like missing values, duplicate rows, and outliers during exploratory data analysis.
Dokumen tersebut memberikan penjelasan mengenai konsep dasar data mining klasifikasi, proses klasifikasi menggunakan algoritma Naive Bayes, serta contoh kasus klasifikasi menggunakan atribut usia, pendapatan, pekerjaan, dan punya deposito atau tidak.
Dokumen tersebut membahas tentang clustering, yaitu teknik pembelajaran tak terawasi untuk mengelompokkan data berdasarkan kesamaan. Dibahas beberapa metode clustering seperti K-Means, hierarchical clustering, dan Fuzzy C-Means beserta ilustrasinya."
Big data merupakan data yang beragam, cepat berubah, dan berukuran besar sehingga sulit ditangani dengan teknologi konvensional. Big data dapat memberikan manfaat seperti mengetahui respon masyarakat terhadap produk, membantu pengambilan keputusan, dan mengetahui perilaku pelanggan. Ada tantangan dalam penerapan big data seperti keterbatasan SDM dan biaya mahal. Diperlukan perlindungan privasi konsumen di era ekonomi digital.
Data Mining digunakan untuk mengekstrak pola dan pengetahuan dari data besar yang kompleks untuk memecahkan masalah bisnis. Teknik utama Data Mining meliputi estimasi, prediksi, klasifikasi, klastering dan asosiasi. Metode pembelajaran terdiri dari pembelajaran terbimbing, tidak terbimbing dan semi terbimbing.
Dokumen tersebut membahas tentang algoritma k-means clustering. K-means clustering adalah salah satu metode clustering non-hirarki yang mengelompokkan data menjadi satu atau lebih cluster dengan menentukan nilai centroid awal secara acak lalu menghitung jarak antara data dan centroid untuk mengelompokkannya ke cluster mana. Algoritma k-means melakukan iterasi dengan menghitung centroid baru sampai posisi data tidak berubah lagi.
Metode pencarian heuristik merupakan teknik untuk meningkatkan efisiensi proses pencarian dalam state space dengan memilih cabang-cabang yang paling mungkin menyebabkan penyelesaian masalah. Metode-metode pencarian heuristik yang dijelaskan meliputi generate and test, hill climbing, best first search, dan simulated annealing.
Dokumen tersebut membahas tentang klasifikasi data mining, meliputi definisi klasifikasi, langkah-langkah klasifikasi, contoh task klasifikasi, teknik klasifikasi seperti decision tree dan Naive Bayes, serta parameter evaluasi model."
Dokumen tersebut membahas beberapa metode pencarian heuristik dalam artificial intelligence, yaitu generate and test, hill climbing, dan best first search. Metode-metode tersebut digunakan untuk mencari solusi masalah secara efisien dengan memperkirakan kemungkinan solusi terbaik.
Ringkasan dokumen tersebut adalah:
1. Dokumen tersebut membahas tentang jaringan syaraf tiruan dan cara kerjanya yang meniru otak manusia.
2. Jaringan syaraf tiruan terdiri atas neuron-neuron yang saling terhubung dan memiliki bobot untuk memproses informasi secara kolektif.
3. Ada beberapa metode pembelajaran jaringan syaraf tiruan seperti pembelajaran terawasi dan tak terawasi untuk menentukan bobot ant
Certainty factor (faktor kepastian) diperkenalkan oleh Shortliffe dan Buchanan dalam sistem pakar MYCIN untuk mengakomodasi ketidakpastian pemikiran seorang pakar. Faktor kepastian menggunakan nilai antara -1 hingga 1 untuk menggambarkan tingkat keyakinan seorang pakar terhadap suatu pernyataan. Faktor kepastian dapat dihitung secara manual maupun didasarkan pada wawancara dengan pakar.
Data science adalah ilmu yang menggabungkan matematika, statistika, dan ilmu komputer untuk menganalisis data besar dan kecil guna menemukan pola dan memprediksi dengan akurat, membantu pengambilan keputusan. Kemampuan pentingnya termasuk pemrograman, basis data, analisis dan visualisasi data, serta pemahaman masalah bisnis. Data science mencakup data mining untuk menemukan pola baru dan machine learning untuk melatih sistem agar belajar sendiri
Matematika Diskrit - 11 kompleksitas algoritma - 03KuliahKita
Dokumen tersebut membahas kompleksitas algoritma dan notasi O-besar untuk menentukan orde pertumbuhan fungsi waktu algoritma. Notasi O-besar digunakan untuk membandingkan beberapa algoritma penyelesaian masalah dan menentukan algoritma terbaik berdasarkan orde pertumbuhannya.
Algoritma C4.5 adalah algoritma klasifikasi data mining yang merupakan pengembangan dari algoritma ID3. C4.5 mampu menangani atribut kosong dengan mengisi nilai berdasarkan nilai dominan, dan memilih atribut akar berdasarkan nilai gain tertinggi yang dihitung menggunakan rumus entropy. Studi kasus mendemonstrasikan pembentukan pohon keputusan C4.5 untuk klasifikasi data.
Dokumen tersebut membahas tentang pengertian citra digital, komponen-komponen citra digital seperti piksel, warna, resolusi, dan kedalaman bit. Juga dibahas teknologi pengolahan citra seperti transformasi, sampling, dan segmentasi citra.
This document discusses several techniques for measuring similarity and dissimilarity between data objects: Euclidean distance, Manhattan distance, Chebyshev distance, and cosine similarity. It provides definitions and formulas for each technique and provides examples to illustrate how they work. The techniques can be used for tasks like classification, clustering, and image processing.
This document provides an overview of decision tree classification algorithms. It defines key concepts like decision nodes, leaf nodes, splitting, pruning, and explains how a decision tree is constructed using attributes to recursively split the dataset into purer subsets. It also describes techniques like information gain and Gini index that help select the best attributes to split on, and discusses advantages like interpretability and disadvantages like potential overfitting.
The document discusses the Naive Bayes classifier. It begins with an introduction to probability and defines the formula for Naive Bayes classification. It then provides an example dataset to demonstrate how to calculate the probabilities of each attribute value belonging to each class. The example shows calculating the probabilities for attributes like major, gender, school origin, GPA, and assistant status to predict whether a student's study duration will be on time or late.
Dokumen tersebut membahas tentang clustering, yaitu teknik pembelajaran tak terawasi untuk mengelompokkan data berdasarkan kesamaan. Dibahas beberapa metode clustering seperti K-Means, hierarchical clustering, dan Fuzzy C-Means beserta ilustrasinya."
Big data merupakan data yang beragam, cepat berubah, dan berukuran besar sehingga sulit ditangani dengan teknologi konvensional. Big data dapat memberikan manfaat seperti mengetahui respon masyarakat terhadap produk, membantu pengambilan keputusan, dan mengetahui perilaku pelanggan. Ada tantangan dalam penerapan big data seperti keterbatasan SDM dan biaya mahal. Diperlukan perlindungan privasi konsumen di era ekonomi digital.
Data Mining digunakan untuk mengekstrak pola dan pengetahuan dari data besar yang kompleks untuk memecahkan masalah bisnis. Teknik utama Data Mining meliputi estimasi, prediksi, klasifikasi, klastering dan asosiasi. Metode pembelajaran terdiri dari pembelajaran terbimbing, tidak terbimbing dan semi terbimbing.
Dokumen tersebut membahas tentang algoritma k-means clustering. K-means clustering adalah salah satu metode clustering non-hirarki yang mengelompokkan data menjadi satu atau lebih cluster dengan menentukan nilai centroid awal secara acak lalu menghitung jarak antara data dan centroid untuk mengelompokkannya ke cluster mana. Algoritma k-means melakukan iterasi dengan menghitung centroid baru sampai posisi data tidak berubah lagi.
Metode pencarian heuristik merupakan teknik untuk meningkatkan efisiensi proses pencarian dalam state space dengan memilih cabang-cabang yang paling mungkin menyebabkan penyelesaian masalah. Metode-metode pencarian heuristik yang dijelaskan meliputi generate and test, hill climbing, best first search, dan simulated annealing.
Dokumen tersebut membahas tentang klasifikasi data mining, meliputi definisi klasifikasi, langkah-langkah klasifikasi, contoh task klasifikasi, teknik klasifikasi seperti decision tree dan Naive Bayes, serta parameter evaluasi model."
Dokumen tersebut membahas beberapa metode pencarian heuristik dalam artificial intelligence, yaitu generate and test, hill climbing, dan best first search. Metode-metode tersebut digunakan untuk mencari solusi masalah secara efisien dengan memperkirakan kemungkinan solusi terbaik.
Ringkasan dokumen tersebut adalah:
1. Dokumen tersebut membahas tentang jaringan syaraf tiruan dan cara kerjanya yang meniru otak manusia.
2. Jaringan syaraf tiruan terdiri atas neuron-neuron yang saling terhubung dan memiliki bobot untuk memproses informasi secara kolektif.
3. Ada beberapa metode pembelajaran jaringan syaraf tiruan seperti pembelajaran terawasi dan tak terawasi untuk menentukan bobot ant
Certainty factor (faktor kepastian) diperkenalkan oleh Shortliffe dan Buchanan dalam sistem pakar MYCIN untuk mengakomodasi ketidakpastian pemikiran seorang pakar. Faktor kepastian menggunakan nilai antara -1 hingga 1 untuk menggambarkan tingkat keyakinan seorang pakar terhadap suatu pernyataan. Faktor kepastian dapat dihitung secara manual maupun didasarkan pada wawancara dengan pakar.
Data science adalah ilmu yang menggabungkan matematika, statistika, dan ilmu komputer untuk menganalisis data besar dan kecil guna menemukan pola dan memprediksi dengan akurat, membantu pengambilan keputusan. Kemampuan pentingnya termasuk pemrograman, basis data, analisis dan visualisasi data, serta pemahaman masalah bisnis. Data science mencakup data mining untuk menemukan pola baru dan machine learning untuk melatih sistem agar belajar sendiri
Matematika Diskrit - 11 kompleksitas algoritma - 03KuliahKita
Dokumen tersebut membahas kompleksitas algoritma dan notasi O-besar untuk menentukan orde pertumbuhan fungsi waktu algoritma. Notasi O-besar digunakan untuk membandingkan beberapa algoritma penyelesaian masalah dan menentukan algoritma terbaik berdasarkan orde pertumbuhannya.
Algoritma C4.5 adalah algoritma klasifikasi data mining yang merupakan pengembangan dari algoritma ID3. C4.5 mampu menangani atribut kosong dengan mengisi nilai berdasarkan nilai dominan, dan memilih atribut akar berdasarkan nilai gain tertinggi yang dihitung menggunakan rumus entropy. Studi kasus mendemonstrasikan pembentukan pohon keputusan C4.5 untuk klasifikasi data.
Dokumen tersebut membahas tentang pengertian citra digital, komponen-komponen citra digital seperti piksel, warna, resolusi, dan kedalaman bit. Juga dibahas teknologi pengolahan citra seperti transformasi, sampling, dan segmentasi citra.
This document discusses several techniques for measuring similarity and dissimilarity between data objects: Euclidean distance, Manhattan distance, Chebyshev distance, and cosine similarity. It provides definitions and formulas for each technique and provides examples to illustrate how they work. The techniques can be used for tasks like classification, clustering, and image processing.
This document provides an overview of decision tree classification algorithms. It defines key concepts like decision nodes, leaf nodes, splitting, pruning, and explains how a decision tree is constructed using attributes to recursively split the dataset into purer subsets. It also describes techniques like information gain and Gini index that help select the best attributes to split on, and discusses advantages like interpretability and disadvantages like potential overfitting.
The document discusses the Naive Bayes classifier. It begins with an introduction to probability and defines the formula for Naive Bayes classification. It then provides an example dataset to demonstrate how to calculate the probabilities of each attribute value belonging to each class. The example shows calculating the probabilities for attributes like major, gender, school origin, GPA, and assistant status to predict whether a student's study duration will be on time or late.
The document provides an introduction to supervised learning. It discusses how supervised learning models are trained on labelled datasets containing both input data and corresponding results or labels. The model learns from these examples to predict accurate results for new, unseen data. Common applications of supervised learning mentioned include sentiment analysis, recommendations, and spam filtration. Decision trees and K-nearest neighbors are discussed as examples of supervised learning algorithms. Decision trees use a top-down approach to split the dataset into more homogeneous subsets. K-nearest neighbors classifies new data based on similarity to labelled examples in the training set.
Decision Trees - The Machine Learning Magic UnveiledLuca Zavarella
Often a Machine Learning algorithm is seen as one of those magical weapons capable of revealing possible future scenarios to whoever holds it. In truth, it's a direct application of mathematical and statistical concepts, which sometimes generate complex models to be interpreted as output. However, there are predictive models based on decision trees that are really simple to understand. In this slide deck I'll explain what is behind a predictive model of this type.
Here the demo files: https://goo.gl/K6dgWC
Decision trees are a type of supervised learning algorithm used for classification and regression. ID3 and C4.5 are algorithms that generate decision trees by choosing the attribute with the highest information gain at each step. Random forest is an ensemble method that creates multiple decision trees and aggregates their results, improving accuracy. It introduces randomness when building trees to decrease variance.
Decision tree learning involves growing a decision tree from training data to predict target variables. The ID3 algorithm uses a top-down greedy search to build decision trees by selecting the attribute at each node that best splits the data, measured by information gain. It calculates information gain for candidate attributes to determine the attribute that provides the greatest reduction in entropy when used to split the data. The attribute with the highest information gain becomes the decision node. The process then recurses on the sublists produced by each branch.
Decision tree learning involves creating a decision tree that classifies examples by sorting them from the root node to a leaf node. Each node tests an attribute and branches correspond to attribute values. Instances are classified by traversing the tree in this way. The ID3 algorithm uses information gain to select the attribute that best splits examples at each node, creating a greedy top-down search through possible trees. It calculates information gain, which measures the expected reduction in entropy (impurity), to determine which attribute best classifies examples at each step.
This document discusses decision trees and their use for classification. It provides examples to illustrate key concepts:
- Decision trees classify instances by sorting them down the tree from root to leaf node, where each leaf represents a classification outcome. Nodes test attribute values and branches represent test outcomes.
- An example decision tree classifies whether to play golf based on weather attributes like temperature and humidity. It generates rules like "if sunny and humidity below 75% then play."
- Classification accuracy is measured by how many test instances the tree correctly classifies. Information gain is used to select the most informative attribute to split on at each node, improving classification.
Machine Learning Unit-5 Decesion Trees & Random Forest.pdfAdityaSoraut
Its all about Machine learning .Machine learning is a field of artificial intelligence (AI) that focuses on the development of algorithms and statistical models that enable computers to perform tasks without explicit programming instructions. Instead, these algorithms learn from data, identifying patterns, and making decisions or predictions based on that data.
There are several types of machine learning approaches, including:
Supervised Learning: In this approach, the algorithm learns from labeled data, where each example is paired with a label or outcome. The algorithm aims to learn a mapping from inputs to outputs, such as classifying emails as spam or not spam.
Unsupervised Learning: Here, the algorithm learns from unlabeled data, seeking to find hidden patterns or structures within the data. Clustering algorithms, for instance, group similar data points together without any predefined labels.
Semi-Supervised Learning: This approach combines elements of supervised and unsupervised learning, typically by using a small amount of labeled data along with a large amount of unlabeled data to improve learning accuracy.
Reinforcement Learning: This paradigm involves an agent learning to make decisions by interacting with an environment. The agent receives feedback in the form of rewards or penalties, enabling it to learn the optimal behavior to maximize cumulative rewards over time.Machine learning algorithms can be applied to a wide range of tasks, including:
Classification: Assigning inputs to one of several categories. For example, classifying whether an email is spam or not.
Regression: Predicting a continuous value based on input features. For instance, predicting house prices based on features like square footage and location.
Clustering: Grouping similar data points together based on their characteristics.
Dimensionality Reduction: Reducing the number of input variables to simplify analysis and improve computational efficiency.
Recommendation Systems: Predicting user preferences and suggesting items or actions accordingly.
Natural Language Processing (NLP): Analyzing and generating human language text, enabling tasks like sentiment analysis, machine translation, and text summarization.
Machine learning has numerous applications across various domains, including healthcare, finance, marketing, cybersecurity, and more. It continues to be an area of active research and
The document discusses decision trees and random forest algorithms. It begins with an outline and defines the problem as determining target attribute values for new examples given a training data set. It then explains key requirements like discrete classes and sufficient data. The document goes on to describe the principles of decision trees, including entropy and information gain as criteria for splitting nodes. Random forests are introduced as consisting of multiple decision trees to help reduce variance. The summary concludes by noting out-of-bag error rate can estimate classification error as trees are added.
Process the sentiments of NLP with Naive Bayes Rule, Random Forest, Support Vector Machine, and much more.
Thanks, for your time, if you enjoyed this short slide there are tons of topics in advanced analytics, data science, and machine learning available in my medium repo. https://medium.com/@bobrupakroy
1. Machine learning is a branch of artificial intelligence concerned with algorithms that allow computers to learn from data without being explicitly programmed.
2. A major focus is automatically learning patterns from training data to make intelligent decisions on new data. This is challenging since the set of all possible behaviors given all inputs is too large to observe completely.
3. Machine learning is applied in areas like search engines, medical diagnosis, stock market analysis, and game playing by developing algorithms that improve automatically through experience. Decision trees, Bayesian networks, and neural networks are common algorithms.
The document discusses decision tree classification algorithms. It defines key concepts like decision nodes, leaf nodes, splitting, pruning, and describes how a decision tree works. It starts with the root node and uses attribute selection measures like information gain or Gini index to recursively split nodes into subtrees until reaching leaf nodes. Decision trees can model human decision making and have intuitive tree structures, though they may overfit and have complexity issues with many layers.
Introduction to Datamining Concept and TechniquesSơn Còm Nhom
This document provides an introduction to data mining techniques. It discusses data mining concepts like data preprocessing, analysis, and visualization. For data preprocessing, it describes techniques like similarity measures, down sampling, and dimension reduction. For data analysis, it explains clustering, classification, and regression methods. Specifically, it gives examples of k-means clustering and support vector machine classification. The goal of data mining is to retrieve hidden knowledge and rules from data.
1. The document discusses decision trees, bagging, and random forests. It provides an overview of how classification and regression trees (CART) work using a binary tree data structure and recursive data partitioning. It then explains how bagging generates diverse trees by bootstrap sampling and averages the results. Finally, it describes how random forests improve upon bagging by introducing random feature selection to generate less correlated and more accurate trees.
The document discusses decision tree learning and provides details about key concepts and algorithms. It defines decision trees as tree-structured classifiers that use internal nodes to represent dataset features, branches for decision rules, and leaf nodes for outcomes. The document then describes common decision tree terminology like root nodes, leaf nodes, splitting, branches, and pruning. It also outlines the basic steps of a decision tree algorithm, which involves beginning with a root node, finding the best attribute, dividing the dataset, generating decision tree nodes recursively, and ending with leaf nodes. Finally, it discusses two common attribute selection measures - information gain and Gini index - that are used to select the best attributes for decision tree nodes.
This document provides an overview of classification and decision tree induction. It discusses basic concepts of classification and prediction. Classification involves analyzing labeled datasets to build a model, while prediction involves forecasting future trends. Decision tree induction is then explained as a common classification technique. It involves learning classification rules from training data and using test data to evaluate the rules. The document outlines the decision tree induction process and algorithms. It also discusses attribute selection measures, pruning techniques, and compares decision trees to naive Bayesian classification.
A decision tree is a guide to the potential results of a progression of related choices. It permits an individual or association to gauge potential activities against each other dependent on their costs, probabilities, and advantages. They can be utilized either to drive casual conversation or to outline a calculation that predicts the most ideal decision scientifically.
This is the most simplest and easy to understand ppt. Here you can define what is decision tree,information gain,gini impurity,steps for making decision tree there pros and cons etc which will helps you to easy understand and represent it.
Similar to Data mining 5 klasifikasi decision tree dan random forest (20)
Analysis insight about a Flyball dog competition team's performanceroli9797
Insight of my analysis about a Flyball dog competition team's last year performance. Find more: https://github.com/rolandnagy-ds/flyball_race_analysis/tree/main
Learn SQL from basic queries to Advance queriesmanishkhaire30
Dive into the world of data analysis with our comprehensive guide on mastering SQL! This presentation offers a practical approach to learning SQL, focusing on real-world applications and hands-on practice. Whether you're a beginner or looking to sharpen your skills, this guide provides the tools you need to extract, analyze, and interpret data effectively.
Key Highlights:
Foundations of SQL: Understand the basics of SQL, including data retrieval, filtering, and aggregation.
Advanced Queries: Learn to craft complex queries to uncover deep insights from your data.
Data Trends and Patterns: Discover how to identify and interpret trends and patterns in your datasets.
Practical Examples: Follow step-by-step examples to apply SQL techniques in real-world scenarios.
Actionable Insights: Gain the skills to derive actionable insights that drive informed decision-making.
Join us on this journey to enhance your data analysis capabilities and unlock the full potential of SQL. Perfect for data enthusiasts, analysts, and anyone eager to harness the power of data!
#DataAnalysis #SQL #LearningSQL #DataInsights #DataScience #Analytics
State of Artificial intelligence Report 2023kuntobimo2016
Artificial intelligence (AI) is a multidisciplinary field of science and engineering whose goal is to create intelligent machines.
We believe that AI will be a force multiplier on technological progress in our increasingly digital, data-driven world. This is because everything around us today, ranging from culture to consumer products, is a product of intelligence.
The State of AI Report is now in its sixth year. Consider this report as a compilation of the most interesting things we’ve seen with a goal of triggering an informed conversation about the state of AI and its implication for the future.
We consider the following key dimensions in our report:
Research: Technology breakthroughs and their capabilities.
Industry: Areas of commercial application for AI and its business impact.
Politics: Regulation of AI, its economic implications and the evolving geopolitics of AI.
Safety: Identifying and mitigating catastrophic risks that highly-capable future AI systems could pose to us.
Predictions: What we believe will happen in the next 12 months and a 2022 performance review to keep us honest.
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Aggregage
This webinar will explore cutting-edge, less familiar but powerful experimentation methodologies which address well-known limitations of standard A/B Testing. Designed for data and product leaders, this session aims to inspire the embrace of innovative approaches and provide insights into the frontiers of experimentation!
Global Situational Awareness of A.I. and where its headedvikram sood
You can see the future first in San Francisco.
Over the past year, the talk of the town has shifted from $10 billion compute clusters to $100 billion clusters to trillion-dollar clusters. Every six months another zero is added to the boardroom plans. Behind the scenes, there’s a fierce scramble to secure every power contract still available for the rest of the decade, every voltage transformer that can possibly be procured. American big business is gearing up to pour trillions of dollars into a long-unseen mobilization of American industrial might. By the end of the decade, American electricity production will have grown tens of percent; from the shale fields of Pennsylvania to the solar farms of Nevada, hundreds of millions of GPUs will hum.
The AGI race has begun. We are building machines that can think and reason. By 2025/26, these machines will outpace college graduates. By the end of the decade, they will be smarter than you or I; we will have superintelligence, in the true sense of the word. Along the way, national security forces not seen in half a century will be un-leashed, and before long, The Project will be on. If we’re lucky, we’ll be in an all-out race with the CCP; if we’re unlucky, an all-out war.
Everyone is now talking about AI, but few have the faintest glimmer of what is about to hit them. Nvidia analysts still think 2024 might be close to the peak. Mainstream pundits are stuck on the wilful blindness of “it’s just predicting the next word”. They see only hype and business-as-usual; at most they entertain another internet-scale technological change.
Before long, the world will wake up. But right now, there are perhaps a few hundred people, most of them in San Francisco and the AI labs, that have situational awareness. Through whatever peculiar forces of fate, I have found myself amongst them. A few years ago, these people were derided as crazy—but they trusted the trendlines, which allowed them to correctly predict the AI advances of the past few years. Whether these people are also right about the next few years remains to be seen. But these are very smart people—the smartest people I have ever met—and they are the ones building this technology. Perhaps they will be an odd footnote in history, or perhaps they will go down in history like Szilard and Oppenheimer and Teller. If they are seeing the future even close to correctly, we are in for a wild ride.
Let me tell you what we see.
The Ipsos - AI - Monitor 2024 Report.pdfSocial Samosa
According to Ipsos AI Monitor's 2024 report, 65% Indians said that products and services using AI have profoundly changed their daily life in the past 3-5 years.
Data mining 5 klasifikasi decision tree dan random forest
1. Decision Tree and
Random Forest
Irwansyah Saputra, S.Kom., M.Kom., MTA
Founder of Multinity Indonesia
2. Tentang Saya
• Irwansyah Saputra
• Dosen Ilmu Komputer
• Mahasiswa S3 Ilmu Komputer IPB University
• Bidang Kajian: Computational Intelligence &
Optimization (Data mining, machine
learning, artificial intelligence)
Halo semuanya, saya suka belajar tentang
segala hal dan suka berbagi pengetahuan. Saya
juga sering menjadi pembicara di berbagai
seminar.
Kontak yang bisa dihubungi:
WhatsApp: 0895323302241
Instagram: @irwansight_
Web: https://irw.one
3. Disclaimer
Materi ini digunakan sebagai bahan ajar Program Data Mining di
Multinity.id
Silakan gunakan, mohon untuk tidak mengubah template.
Jika Anda memiliki kesulitan dalam memahami materi pada slide
ini, silakan belajar di Multinity.id
4. Referensi
1. Jiawei Han and Micheline Kamber, Data Mining: Concepts and Techniques Third
Edition, Elsevier, 2012
2. Ian H. Witten, Frank Eibe, Mark A. Hall, Data mining: Practical Machine Learning
Tools and Techniques 3rd Edition, Elsevier, 2011
3. Markus Hofmann and Ralf Klinkenberg, RapidMiner: Data Mining Use Cases and
Business Analytics Applications, CRC Press Taylor & Francis Group, 2014
4. Daniel T. Larose, Discovering Knowledge in Data: an Introduction to Data Mining,
John Wiley & Sons, 2005
5. Ethem Alpaydin, Introduction to Machine Learning, 3rd ed., MIT Press, 2014
6. Florin Gorunescu, Data Mining: Concepts, Models and Techniques, Springer,
2011
7. Oded Maimon and Lior Rokach, Data Mining and Knowledge Discovery Handbook
Second Edition, Springer, 2010
8. Warren Liao and Evangelos Triantaphyllou (eds.), Recent Advances in Data Mining
of Enterprise Data: Algorithms and Applications, World Scientific, 2007
9. Suyanto, DATA MINING: Untuk klasifikasi dan klasterisasi data, Penerbit
Informatika, 2017
6. Decision tree dalam keseharian
Dalam kehidupan sehari-hari, kita pasti akan menggunakan algoritme decision tree
walaupun mungkin kita menggunakannya tanpa sadar. Misalnya syarat mengikuti
ujian universitas adalah:
Terdaftar sebagai mahasiswa aktif
Tidak terkena sanksi akademik
Tidak ada nilai C
Sanksi
akademik
Mahasiswa
Tidak ikut
ujian
Aktif Tidak Aktif
Nilai C
Tidak ikut
ujian
ada
Tidak ada
Tidak ikut
ujian
ada
Ikut ujian
Tidak ada
7. Ide dasar Decision tree
• Mencari ukuran varians / entropi dari berbagai atribut.
• Mendapatkan akar sebagai atribut yang memiliki informasi
terbanyak dalam dataset berdasarkan ukuran entropi.
• Kemudian, membuat cabang untuk atribut yang memiliki peringkat
di bawah akar. Semakin kecil informasi yang dimiliki, atribut akan
semakin di bawah.
• Ujungnya adalah daun. Di tingkatan ini, perhitungan akan berhenti
dilakukan karena sudah mencapai akhir pohon.
• Setelah model pohon dibuat, akan menghasilkan aturan IF – Then
yang dapat digunakan dan dipahami tanpa membutuhkan
pengetahuan statistika sama sekali.
8. Struktur Pohon
Keterangan:
Root Node = biasa juga disebut dengan node induk. Yaitu node
pertama yang ditempati oleh atribut dengan nilai informasi tertinggi.
Decision Node = pemisahan sub node menjadi lebih banyak sub node.
Leaf Node = node terminal, karena tidak dapat dipisahkan lagi.
Sub-Tree = biasa disebut cabang, yaitu bagian pohon dari pohon
keseluruhan.
9. Kenapa harus mencari root node?
• Jika menggunakan sembarang atribut sebagai root, maka
aturan yang dihasilkan akan tidak berguna sama sekali.
• Mencari atribut sebagai root untuk mengetahui seberapa
pengaruhnya atribut tersebut pada kelas target. Tentunya,
atribut yang memiliki informasi tertinggi layak menjadi root.
• Tanpa root, kita tak bisa membuat struktur pohon yang
benar.
• Root akan sangat penting dalam membuat aturan yang
dihasilkan dari pohon.
10. Bagaimana cara mencari root?
• Pertama, kita harus mendapatkan varians dari setiap kelas
pada atribut dan total target.
• Hitung varians tersebut dengan entropi.
• Cari weighting average dari setiap atribut.
• Lakukan perhitungan entropi total – weighting average. Ini
disebut information gain.
• atribut yang memiliki information gain tertinggi, maka layak
menjadi root.
11. Apa itu entropi?
• Sederhananya, Entropi adalah ukuran ketidakteraturan (measure of
disorder), bisa juga disebut dengan ukuran kemurnian (purity).
Rumusnya:
𝐸 𝑆 =
𝑖=1
𝑛
−𝑝𝑖 log2 𝑝𝑖
Keterangan:
𝑆 = Himpunan kasus
𝑛 = Jumlah anggota dari 𝑆
𝑝𝑖 = proporsi dari 𝑆𝑖 terhadap 𝑆
12. Contoh sederhana
• Misalnya kita memiliki dataset yang terdiri dari kelas positif dan
kelas negatif , sehingga ‘i’ pada rumus bisa bernilai positif atau
negatif.
• Jika kita memiliki total berjumlah 10 tupel, lalu terbagi pada data
positif sebanyak 3 tupel dan untuk data negatif sebanyak 7 tupel,
maka P+ adalah 3/10 dan P- adalah 7/10.
𝐸 𝑆 =
𝑖=1
𝑛
−𝑝𝑖 log2 𝑝𝑖
𝐸 𝑆 = −
3
10
× log2
3
10
+ −
7
10
× log2
7
10
≈ 0.88
13. Visualisasi Entropi
Kita lihat lingkaran yang paling kiri (hanya berisi data negatif), lingkaran tersebut terletak di angka 0
pada P+. Wajar saja, karena yang kita hitung adalah P+, sehingga jika lingkaran berisi kumpulan nilai
negatif, maka ia akan berada di paling kiri.
Kita bisa memahami jika lingkaran hanya berisi data negatif atau positif saja, maka itu berarti tingkat
kemurniannya tinggi dan tingkat ketidakteraturannya rendah.
Selain itu kita bisa perhatikan lingkaran di tengah yang menunjukkan keberagaman dari kelas yang
dibagi sama rata antara kelas positif dan negatif. Terlihat bahwa lingkaran tersebut terletak pada nilai
Entropi = 1 di sumbu y. Artinya semakin tinggi keberagaman / ketidakteraturan dalam suatu
lingkaran, maka semakin tinggi juga nilai entropinya.
𝐸 𝑆 =
𝑖=1
𝑛
−𝑝𝑖 log2 𝑝𝑖
𝐸 𝑆 = −
3
10
× log2
3
10
+ −
7
10
× log2
7
10
≈ 0.88
14. Kesimpulan Entropi
• Berdasarkan seluruh penjelasan di atas, kita bisa menyimpulkan bahwa entropi
merupakan ukuran ketidakteraturan atau ukuran kemurnian.
• Semakin tinggi ukuran ketidakteraturan, semakin rendah ukuran kemurnian.
Begitu juga sebaliknya.
• Tujuan kita adalah bagaimana caranya mengurangi ketidakteraturan tersebut.
15. Apa itu Information Gain?
• Information gain merupakan teknik untuk mengurangi ketidakteraturan
entropi sehingga bisa mendapatkan ukuran informasi dari hasilnya.
• Semakin tinggi nilai information gain, berarti semakin tinggi juga
informasi yang didapatkan.
Rumusnya:
𝐼𝐺 𝑌, 𝑋 = 𝐸 𝑌 − 𝐸 𝑌 𝑋
Keterangan:
𝐸 𝑌 = entropi dari atribut target
𝐸 𝑌 𝑋 = entropi rata-rata dari atribut prediktor terhadap atribut
target
𝑋 = atribut prediktor
𝑌 = atribut target
16. Contoh kasus
Nomor Pelanggaran Bonus
1 Excellent Normal
2 Excellent Normal
3 Excellent Normal
4 Excellent High
5 Good Normal
6 Good Normal
7 Good Normal
8 Good Normal
9 Good High
10 Good High
11 Poor High
12 Poor High
13 Poor High
14 Poor High
Pelanggaran Bonus
Normal High Total
Excellent 3 1 4
Good 4 2 6
Poor 0 4 4
Total 7 7 14
Ubah menjadi tabel kontingensi,
agar lebih mudah
• Berdasarkan tabel kontingensi, kita bisa mengetahui
bahwa atribut Pelanggaran terdiri dari tiga kategori
yaitu Excellent, Good dan Poor.
• Sedangkan atribut target Bonus terdiri dari dua
kategori yaitu High dan Normal. Jumlah kelas dari
kategori High dan Normal didistribusikan dengan
sempurna karena jumlahnya sama rata, yaitu 7 data
untuk setiap kelas.
18. Penyelesaian
• Saatnya untuk mencari nilai information gain dari data tersebut menggunakan
rumus:
𝐼𝐺 𝑌, 𝑋 = 𝐸 𝑌 − 𝐸 𝑌 𝑋
𝐼𝐺 𝐵𝑜𝑛𝑢𝑠, 𝑃𝑒𝑙𝑎𝑛𝑔𝑔𝑎𝑟𝑎𝑛 = 𝐸 𝐵𝑜𝑛𝑢𝑠 − 𝐸 𝐵𝑜𝑛𝑢𝑠 𝑃𝑒𝑙𝑎𝑛𝑔𝑔𝑎𝑟𝑎𝑛
= 1 − 0.625
= 0.375
• Dari nilai information gain tersebut, kita dapat menyimpulkan bahwa
informasi yang dimiliki oleh atribut Pelanggaran terhadap atribut targetnya
(yaitu atribut Bonus) adalah sebesar 0.375 atau 37.5% .
19. Perbedaan ID3 dan C5.0
• Letak perbedaan paling mendasar dari ID3 dan C5.0 adalah pada perhitungan gain. Jika ID3
menggunakan information gain untuk menyeleksi atribut dan memilihnya sebagai akar, pada
C5.0 yang digunakan adalah gain rasio. Perbedaan lebih lanjut antara information gain dan
gain rasio dapat dilihat sebagai berikut:
1. Gain rasio bisa digunakan untuk menghitung kelas yang memiliki tipe data numerik
maupun kategorik.
2. Gain rasio hanya dimiliki oleh algoritme C4.5
3. Gain rasio bisa memberikan nilai sedikit lebih spesifik dibandingkan information gain
dalam beberapa kasus.
20. Menghitung Gain Ratio
• Cara menghitung nilai gain rasio cukup mudah. Hanya dengan menentukan nilai
information gain dan splitinfo dari suatu kelas.
• Persamaan SplitInfo adalah:
𝑆𝑝𝑙𝑖𝑡𝐼𝑛𝑓𝑜𝐴(𝐷) = −
𝑗=1
𝑣
|𝐷𝑗|
|𝐷|
× 𝑙𝑜𝑔2(
|𝐷𝑗|
|𝐷|
)
Keterangan:
𝐷𝑗 = Jumlah setiap kelas dalam suatu atribut.
𝐷 = Jumlah seluruh tupel dalam dataset.
21. Contoh kasus
𝑆𝑝𝑙𝑖𝑡𝐼𝑛𝑓𝑜𝐴(𝐷) = −
𝑗=1
𝑣
𝐷𝑗
𝐷
× 𝑙𝑜𝑔2(
𝐷𝑗
𝐷
)
= −
4
14
× log2
4
14
+ −
6
14
× log2
6
14
+ −
4
14
× log2
4
14
= 1.557
• Setelah kita dapatkan splitinfo, kita bisa mencari gain rasio dengan rumus:
𝐺𝑎𝑖𝑛𝑅𝑎𝑡𝑖𝑜 𝐴 =
𝐺𝑎𝑖𝑛 𝐴
𝑆𝑝𝑙𝑖𝑡𝐼𝑛𝑓𝑜 𝐴
=
0.375
1.557
= 0.241
Pelanggaran Bonus
Normal High Total
Excellent 3 1 4
Good 4 2 6
Poor 0 4 4
Total 7 7 14
22. Kasus Decision Tree
ID Outlook Temp. Humidity Wind Decision
0 Sunny Hot High Weak No
1 Sunny Hot High Strong No
2 Overcast Hot High Weak Yes
3 Rain Mild High Weak Yes
4 Rain Cool Normal Weak Yes
5 Rain Cool Normal Strong No
6 Overcast Cool Normal Strong Yes
7 Sunny Mild High Weak No
8 Sunny Cool Normal Weak Yes
9 Rain Mild Normal Weak Yes
10 Sunny Mild Normal Strong Yes
11 Overcast Mild High Strong Yes
12 Overcast Hot Normal Weak Yes
13 Rain Mild High Strong No
Keterangan dataset:
atribut prediktor terdiri dari empat atribut
yaitu Outlook, Temperature, Humidity dan
Wind.
atribut target terdiri dari satu atribut yaitu
Decision.
Semua atribut memiliki tipe data yang sama
yaitu kategorik.
23. Buat tabel kontingensi
• Ubah ke dalam bentuk tabel kontingensi
Outlook Decision
Yes No Total
Overcast 4 0 4
Rain 4 1 5
Sunny 2 3 5
Total 7 7 14
Temp. Decision
Yes No Total
Cool 0 4 4
Hot 2 2 4
Mild 2 4 6
Total 4 10 14
Humidity Decision
Yes No Total
High 4 3 7
Normal 7 0 7
Total 11 3 14
Wind Decision
Yes No Total
Weak 2 6 8
Strong 4 2 6
Total 6 8 14
32. atribut
Decision
Entropy
Information
Gain
Yes No Total
Humidity | High 4 3 7 0.985
Outlook
Overcas
t
2 0 2
0
0.6995
Rain 1 1 2 1
Sunny 0 3 3 0
Temp.
Cool 0 0 0 0
0.0203
Hot 1 2 3 0.918
Mild 2 2 4 1
Wind
Weak 2 2 4 1
0.0203
Strong 1 2 3 0.918
Lakukan pencarian cabang
ID Outlook Temp. Humidity Wind Decision
0 Sunny Hot High Weak No
1 Sunny Hot High Strong No
2 Overcast Hot High Weak Yes
3 Rain Mild High Weak Yes
7 Sunny Mild High Weak No
11 Overcast Mild High Strong Yes
13 Rain Mild High Strong No
33. Struktur Pohon yang dihasilkan
Outlook
Humidity
Yes
High Normal
? No
Sunny
Yes
Overcast
Rain
34. Lakukan pencarian cabang
ID Outlook Temp.
Humidit
y
Wind Decision
3 Rain Mild High Weak Yes
13 Rain Mild High Strong No
atribut
Decision Entrop
y
Informatio
n Gain
Yes No Total
Humidity |
High and
Outlook | Rain
1 1 2 1
Temp.
Cool 0 0 0 0
0
Hot 0 0 0 0
Mild 1 1 2 1
Wind
Weak 1 0 1 0
1
Strong 0 1 1 0
35. Struktur Pohon yang dihasilkan
Outlook
Humidity
Yes
High Normal
Wind No
Sunny
Yes
Overcast
Rain
No
Strong
Yes
Weak
36. Aturan yang dihasilkan
If Humidity = Normal, then Yes.
If Humidity = High and Outlook = Sunny, then No.
If Humidity = High and Outlook = Overcast, then Yes.
If Humidity = High and Outlook = Sunny and Wind = Strong, then No.
If Humidity = High and Outlook = Sunny and Wind = Weak, then Yes.
Outlook
Humidity
Yes
High Normal
Wind No
Sunny
Yes
Overcast
Rain
No
Strong
Yes
Weak
38. Ide Random Forest
• Semakin banyak kemungkinan yang dibuat, maka peluang
benar semakin banyak juga.
• Berisi banyak decision tree kemudian dicari nilai mayoritas.
• Banyaknya decision tree adalah hyperparamater. Artinya
bisa diatur sendiri.
• Satu decision tree rentan terkena overfitting, sehingga
dilakukan bagging.
39. Probabilitas
• Saat seseorang bertaruh dengan uang $100, maka ada
beberapa kemungkinan:
• Jika ia bermain sekali, maka kemungkinan menang atau
kalah adalah 50:50
• Sehingga, kita bisa memecah uang tersebut untuk beberapa
kali permainan.
• Karena semakin banyak ia bermain, maka semakin banyak
peluang ia menang.
• Ini konsep dasar Random Forest
40. Apa buktinya?
Misalnya:
1.Game 1 — play 100 times, betting $1 each time.
2.Game 2— play 10 times, betting $10 each time.
3.Game 3— play one time, betting $100.
Mungkin hasilnya bisa sama jika melihat ekspektasi:
• Expected Value Game 1 = (0.60*1 + 0.40*-1)*100 = 20
• Expected Value Game 2= (0.60*10 + 0.40*-10)*10 = 20
• Expected Value Game 3= 0.60*100 + 0.40*-100 = 20
42. Random Forest adalah...
• Banyaknya pohon yang dibuat,
akan menghasilkan akurasi
yang beragam.
• Akurasi yang mayoritas, akan
dijadikan hasil akhir random
forest.
43. Cara kerja RF
DATASET
DATASET
DATASET
DATASET
DATASET
1
0
1
1
Model 1
Model 2
Model 3
Model n
Mayoritas
memprediksi 1
• Tentukan jumlah pohon yang akan dibuat. Dalam python disebut dengan n_estimators.
• Lakukan bagging, yaitu mengambil sampel dari atribut dan sampel dari baris untuk dimodelkan dengan
decision tree dan bangun sebanyak jumlah pohon yang ditentukan.
• Biasanya menggunakan gini split indeks untuk membuat pohon. Menggunakan information gain pun
tak masalah.
• Lihat hasil prediksi mayoritas, itu yang akan menjadi hasil akhir dari random forest.
• Jika pada kode, kita bisa membuat ratusan pohon. Pada teknik manual, kita bisa membuat beberapa
sampel pohon sebagai gambaran.
44. Kenapa Random Forest?
• Karena decision tree rentan low bias
dan high variance.
• Low bias: model dapat memprediksi
aturan dengan ketat sehingga hampir
tidak ada bias di dalamnya, karena
sudah semua masuk ke dalam aturan.
• High variance: akibat dari low bias.
Karena aturan sangat ketat, maka
pohon yang dimodelkan semakin
dalam, menyebabkan tingkat varians
yang tinggi dan overfitting.
• Dengan random forest, kita bisa
mengatasi low bias dan high variance.
Karena hanya diberikan beberapa
atribut dan tupel sampel untuk setiap
pohon.
46. Contoh kasus
id temperatur badan sesak nafas batuk diagnosis sakit covid-19
1 tinggi ya tidak ya
2 normal ya ya ya
3 normal tidak tidak tidak
4 tinggi tidak ya tidak
5 tinggi ya tidak ya
6 normal ya tidak ya
7 tinggi ya ya ya
8 normal tidak ya tidak
47. Iterasi Pohon 1
Kita asumsikan bahwa pohon yang akan dibuat sebanyak 3 pohon. Karena dataset memiliki tupel yang
sedikit, maka pohon pertama bisa kita buat dengan melibatkan seluruh atribut dan hilangkan baris nomor
5. Pada kasus ini, pencarian root atau atribut terbaik akan dilakukan dengan menggunakan gini indeks,
tidak dengan information gain atau gain rasio. Tujuan dari tugas ini adalah mencari atribut terbaik dari
berbagai pohon yang dibangun (best split).
id temperatur badan sesak nafas batuk diagnosis sakit covid-19
1 tinggi ya tidak ya
2 normal ya ya ya
3 normal tidak tidak tidak
4 tinggi tidak ya tidak
6 normal ya tidak ya
7 tinggi ya ya ya
8 normal tidak ya tidak
48. Iterasi Pohon 1
• Ubahlah menjadi tabel kontingensi
Temp. Badan
Diagnosis
ya tidak Total
tinggi 2 1 3
normal 2 2 4
Total 4 3 7
Sesak Nafas
Diagnosis
ya tidak Total
ya 4 0 4
tidak 0 3 3
Total 4 3 7
Batuk
Diagnosis
ya tidak Total
ya 2 2 4
tidak 2 1 3
Total 4 3 7
Diagnosis
ya tidak Total
4 3 7
49. Iterasi Pohon 1
• Selanjutnya, hitung gini indeks dari setiap kelas dari atribut yang tersedia dengan rumus:
𝐺𝑖𝑛𝑖 = 1 −
𝑖=1
𝐶
(𝑝𝑖)2
Maka untuk setiap atribut, kita bisa mendapatkan gini indeks:
• 𝑇𝑒𝑚𝑝. 𝐵𝑎𝑑𝑎𝑛|𝑇𝑖𝑛𝑔𝑔𝑖 = 1 −
2
3
2
+
1
3
2
= 0.44
𝑇𝑒𝑚𝑝. 𝐵𝑎𝑑𝑎𝑛|𝑁𝑜𝑟𝑚𝑎𝑙 = 1 −
2
4
2
+
2
4
2
= 0.5
𝑆𝑒𝑠𝑎𝑘 𝑁𝑎𝑓𝑎𝑠|𝑌𝑎 = 1 −
4
4
2
+
0
4
2
= 0
𝑆𝑒𝑠𝑎𝑘 𝑁𝑎𝑓𝑎𝑠|𝑇𝑖𝑑𝑎𝑘 = 1 −
0
3
2
+
3
3
2
= 0
𝐵𝑎𝑡𝑢𝑘|𝑌𝑎 = 1 −
2
4
2
+
2
4
2
= 0.5
𝐵𝑎𝑡𝑢𝑘|𝑇𝑖𝑑𝑎𝑘 = 1 −
2
3
2
+
1
3
2
= 0.44
50. Iterasi Pohon 1
• Setelah didapatkan semua gini indeks, selanjutnya dicari gini split sebagai berikut:
𝑇𝑒𝑚𝑝. 𝐵𝑎𝑑𝑎𝑛 =
3
7
∗ 0.444444444 +
4
7
∗ 0.5 = 0.476190476
𝑆𝑒𝑠𝑎𝑘 𝑁𝑎𝑓𝑎𝑠 =
5
8
∗ 0 +
3
8
∗ 0 = 0
𝐵𝑎𝑡𝑢𝑘 =
4
7
∗ 0.5 +
3
7
∗ 0.444444444 = 0.476190476
• Terakhir adalah penentuan akar atau atribut terbaik. Berdasarkan perhitungan di atas,
maka atribut Sesak Nafas merupakan atribut terbaik karena memiliki gini split indeks yang
paling rendah.
• Jika kita ingin membuat pohon utuh, kita bisa lakukan langkah selanjutnya seperti pada
algoritme decision tree. Namun, tugas kita hanyalah mencari atribut terbaik dari pohon 1.
51. Iterasi Pohon 2
• Kita buat pohon kedua dengan menghilangkan atribut Batuk, juga
menghilangkan baris 4 dan 6 dari dataset. Maka hasilnya sebagai berikut:
id temperatur badan sesak nafas diagnosis sakit covid-19
1 tinggi ya ya
2 normal ya ya
3 normal tidak tidak
5 tinggi ya ya
7 tinggi ya ya
8 normal tidak tidak
52. Iterasi Pohon 2
• Lakukan perhitungan gini indeks dan gini split indeks dengan rumus seperti pada
pohon pertama, dan hasilnya akan menjadi seperti:
• Berdasarkan perhitungan gini split indeks di atas, maka atribut yang menjadi akar
adalah Sesak Nafas, karena memiliki nilai gini split indeks terkecil.
Temp.
Badan
Diagnosis
gini
indeks
gini split
indeks
ya tidak Total
tinggi 3 0 3 0
0.22
normal 1 2 3 0.44
Total 4 2 6 0.44
Sesak
Nafas
Diagnosis
gini indeks
gini split
indeks
ya tidak Total
ya 4 0 4 0
0
tidak 0 2 2 0
Total 4 2 6 0.44
53. Iterasi Pohon 3
• Asumsikan kita melakukan bagging pada dataset dengan menghilangkan atribut
Sesak Nafas, baris yang dihilangkan adalah 2 dan 7. Hasilnya dapat dilihat sebagai
berikut:
id temperatur badan batuk diagnosis sakit covid-19
1 tinggi tidak ya
3 normal tidak tidak
4 tinggi ya tidak
5 tinggi tidak ya
6 normal tidak ya
8 normal ya tidak
54. Iterasi Pohon 3
• Lakukan perhitungan gini indeks dan gini split indeks dengan rumus seperti pada
pohon pertama, dan hasilnya akan menjadi seperti:
• Terlihat pada perhitungan di atas, terlihat bahwa atribut terbaik adalah Batuk,
karena memiliki nilai gini split indeks terkecil.
Temp.
Badan
Diagnosis
gini
indeks
gini split
indeks
ya tidak Total
tinggi 2 1 3 0.44
0.44
normal 1 2 3 0.44
Total 3 3 6 0.5
Batuk
Diagnosis
gini
indeks
gini split
indeks
ya tidak Total
ya 0 2 2 0
0.25
tidak 3 1 4 0.375
Total 3 3 6 0.5
55. Hasil Akhir
• Berdasarkan iterasi pada ketiga pohon dengan melakukan bagging terhadap
dataset yang tersedia, maka hasilnya adalah atribut Sesak Nafas menjadi atribut
terbaik dan layak untuk menjadi Akar karena memiliki nilai gini split terkecil.
• Walaupun atribut Batuk berhasil menjadi atribut terbaik pada pohon ketiga, itu
hanya disebabkan bagging yang dilakukan terhadap atribut Sesak Nafas.
Sehingga jika dilakukan iterasi pohon secara terus menerus dan melibatkan
atribut Sesak Nafas, akan dipastikan bahwa atribut Sesak Nafas akan menjadi
atribut terbaik dan menjadi akar.
56. Random Forest Regression
• Sama saja. Perbedaannya pada hasil yang didapatkan.
• Pada regresi, hasil bersifat numerik, sehingga untuk
mendapatkan nilai akhirnya dengan cara menghitung
median atau mean dari keseluruhan pohon.
• Akan lebih paham nanti setelah memahami materi regresi.