Decision Trees - VisuallyExplained
Introduction to Decision Trees For Classification Problems with a Python Example. #decisiontree #python #classification #datascience #statistics Code snippets used in the video: ``` Install required packages pip install pandas scikit-learn Download Pokemon dataset wget -q https://gist.githubusercontent.com/ar...\ 194bcff35001e7eb53a2a8b441e8b2c6/raw/\ 92200bc0a673d5ce2110aaad4544ed6c4010f687/pokemon.csv Load dataset import pandas as pd df = pd.read_csv("pokemon.csv").rename(columns={"Type 1": "Type"}) Filter two types only data = data.query("Type.isin(('Electric', 'Grass'))") Training Dataset X = data[['HP', 'Attack', 'Defense', 'Speed', ]] # Features y = (data['Type'] == 'Electric') # = 0 if Grass, = 1 if Electric Train decision tree from sklearn.tree import DecisionTreeClassifier tree = DecisionTreeClassifier(max_depth=1).fit(X, y) Plot decision tree from sklearn.tree import plot_tree plot_tree(tree); Predict using the decision tree predictions = tree.predict(X) predictions[3] # is Pokemon at index 3 of type "Electric"? Accuracy score from sklearn.metrics import accuracy_score accuracy_score(y, tree.predict(X)) change depth to 2 tree = DecisionTreeClassifier(max_depth=2).fit(X, y) ``` -------------------------- This video would not have been possible without the help of Gökçe Dayanıklı.

Decision Tree FROM SCRATCH in Python (no scikit-learn, just math)

Decision and Classification Trees, Clearly Explained!!!

All Machine Learning algorithms explained in 17 min

Decision trees - A friendly introduction

Top 6 Machine Learning Algorithms for Beginners | Classification

Feature selection in machine learning | Full course

How Do Decision Trees Work (Simple Explanation) - Learning and Training Process

Regression Trees, Clearly Explained!!!

Python if __name__ == '__main__': Visually Explained

StatQuest: Random Forests Part 1 - Building, Using and Evaluating

What is Random Forest?

Decision Tree Classification in Python (from scratch!)

Logistic Regression (and why it's different from Linear Regression)

Random Forest Algorithm Clearly Explained!

Every Machine Learning Model Explained in 15 minutes

Latent Space Visualisation: PCA, t-SNE, UMAP | Deep Learning Animated

Let’s Write a Decision Tree Classifier from Scratch - Machine Learning Recipes #8

Linear Regression From Scratch in Python (Mathematical)

The Strange Math That Predicts (Almost) Anything

