Classification is the task in which objects of several categories are categorized into their respective classes using the properties of classes. A classification model is typically used to,
- Predict the class label for a new unlabeled data object
- Provide a descriptive model explaining what features characterize objects in each class
There are various types of classification techniques such as,
- Logistic Regression
- Decision Tree
- K-Nearest Neighbours
- Naive Bayes Classifier
- Support Vector Machines (SVM)
- Random Forest Classification
Decision Tree Classifiers
A decision tree is a flowchart-like tree structure in which the internal node represents feature(or attribute), the branch represents a decision rule, and each leaf node represents the outcome. A Decision Tree consists of,
- Nodes: Test for the value of a certain attribute.
- Edges/Branch: Represents a decision rule and connect to the next node.
- Leaf nodes: Terminal nodes that represent class labels or class distribution.
And this algorithm can easily be implemented in the R language. Some important point about decision tree classifiers are,
- It is more interpretable
- Automatically handles decision-making
- Bisects the space into smaller spaces
- Prone to overfitting
- Can be trained on a small training set
- Majorly affected by noise
Implementation in R
A sample population of 400 people shared their age, gender, and salary with a product company, and if they bought the product or not(0 means no, 1 means yes). Download the dataset Advertisement.csv.
- The training set contains 300 entries.
- The test set contains 100 entries.
Confusion Matrix: [[62, 6], [ 3, 29]]
Visualizing the Train Data:
Visualizing the Test Data:
Decision Tree Diagram:
- Naive Bayes Classifiers
- ML | Dummy classifiers using sklearn
- Passive Aggressive Classifiers
- Decision Tree in R Programming
- Decision Tree for Regression in R Programming
- Decision Making in R Programming - if, if-else, if-else-if ladder, nested if-else, and switch
- Decision Tree
- Decision tree implementation using Python
- Decision Tree Introduction with example
- Python | Decision Tree Regression using sklearn
- ML | Logistic Regression v/s Decision Tree Classification
- Gini Impurity and Entropy in Decision Tree - ML
- Markov Decision Process
- Decision Threshold In Machine Learning
- ES6 | Decision Making
- Weighted Product Method - Multi Criteria Decision Making
- Importance of decision making
- ML - Decision Function
- Tree Entropy in R Programming
- Getting the Modulus of the Determinant of a Matrix in R Programming - determinant() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.