Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Decision Trees - VisuallyExplained

Автор: Visually Explained

Загружено: 2025-03-30

Просмотров: 11112

Описание:

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 Trees - VisuallyExplained

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Decision and Classification Trees, Clearly Explained!!!

Decision and Classification Trees, Clearly Explained!!!

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

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

Деревья решений — Дружественное введение

Деревья решений — Дружественное введение

Machine Intelligence - Lecture 16 (Decision Trees)

Machine Intelligence - Lecture 16 (Decision Trees)

Decision Tree explained

Decision Tree explained

Наглядное руководство по деревьям решений

Наглядное руководство по деревьям решений

Entropy (for data science) Clearly Explained!!!

Entropy (for data science) Clearly Explained!!!

Regression Trees, Clearly Explained!!!

Regression Trees, Clearly Explained!!!

Краткое объяснение больших языковых моделей

Краткое объяснение больших языковых моделей

Что ошибочно пишут в книгах об ИИ [Двойной спуск]

Что ошибочно пишут в книгах об ИИ [Двойной спуск]

Декораторы Python — наглядное объяснение

Декораторы Python — наглядное объяснение

Introductory Session on Machine Learning with R

Introductory Session on Machine Learning with R

Lecture 10 - Decision Trees and Ensemble Methods | Stanford CS229: Machine Learning (Autumn 2018)

Lecture 10 - Decision Trees and Ensemble Methods | Stanford CS229: Machine Learning (Autumn 2018)

What Is Mathematical Optimization?

What Is Mathematical Optimization?

Визуализация скрытого пространства: PCA, t-SNE, UMAP | Глубокое обучение с анимацией

Визуализация скрытого пространства: PCA, t-SNE, UMAP | Глубокое обучение с анимацией

Support Vector Machines: All you need to know!

Support Vector Machines: All you need to know!

Моделирование Монте-Карло

Моделирование Монте-Карло

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

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

Алгоритм случайного леса наглядно объяснен!

Алгоритм случайного леса наглядно объяснен!

StatQuest: Случайные леса Часть 1 - Создание, использование и оценка

StatQuest: Случайные леса Часть 1 - Создание, использование и оценка

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]