Город МОСКОВСКИЙ
00:04:10

Python for Machine Learning | Install Graphviz | Install Pydotplus to visualize Decision Tree

Аватар
Кодовая Пространственность
Просмотры:
33
Дата загрузки:
02.12.2023 20:38
Длительность:
00:04:10
Категория:
Технологии и интернет

Описание

Python for Machine Learning | Install Graphviz | Install Pydotplus to visualize Decision Tree
Python for Machine Learning

Session No 88

Topic to be covered - How to install Graphviz, Pydotplus and execute it
to generate the Decision Tree Graph in Anaconda/Spyder

Code Starts Here
==============

from sklearn.tree import DecisionTreeClassifier
from sklearn import datasets
from IPython.display import Image
from sklearn import tree
import pydotplus

Load data
iris = datasets.load_iris()
X = iris.data
y = iris.target


Create decision tree classifer object
clf_decisiontree = DecisionTreeClassifier(criterion = "entropy",random_state=0)

Train model
model = clf_decisiontree.fit(X, y)

Create DOT data
dot_data = tree.export_graphviz(clf_decisiontree, out_file=None,
feature_names=iris.feature_names,
class_names=iris.target_names)

Draw graph
graph = pydotplus.graph_from_dot_data(dot_data)

Show graph
Image(graph.create_png())

Create PDF
graph.write_pdf("iris2.pdf")

Create PNG
graph.write_png("iris2.png")


All the playlist of this youtube channel
========================================

1. Data Preprocessing in Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPuOjFcbnXLFvSQaHFK3ymUW

2. Confusion Matrix in Machine Learning, ML, AI
https://www.youtube.com/playlist?list=PLE-8p-CwnFPvXzvsEcgb0IZtNsw_0vUzr

3. Anaconda, Python Installation, Spyder, Jupyter Notebook, PyCharm, Graphviz
https://www.youtube.com/playlist?list=PLE-8p-CwnFPsBCsWwz_BvbZZHIVQ6wSZK

4. Cross Validation, Sampling, train test split in Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPsHtol5WXHhq_B3kQPggHH2

5. Drop and Delete Operations in Python Pandas
https://www.youtube.com/playlist?list=PLE-8p-CwnFPtvqVVK7QVFsMvDvp2YgCnR

6. Matrices and Vectors with python
https://www.youtube.com/playlist?list=PLE-8p-CwnFPsndwnZnL7nXW5mIrdRmgdg

7. Detect Outliers in Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPvyCX35yES5D9W7vThiUzwk

8. TimeSeries preprocessing in Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPv10bru3719xzDNIgbO6hXA

9. Handling Missing Values in Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPvOec0LZ40Bt8OQcbLFa236

10. Dummy Encoding Encoding in Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPvu7YriqMZsL9UDbqUUk90x

11. Data Visualisation with Python, Seaborn, Matplotlib
https://www.youtube.com/playlist?list=PLE-8p-CwnFPuYBYsmbfMjROOCzKjCwyMH

12. Feature Scaling in Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPtwpVV3FwzwYZYR5hT3i52G

13. Python 3 basics for Beginner
https://www.youtube.com/playlist?list=PLE-8p-CwnFPu-jseUMtc4i47jQZN4PNbf

14. Statistics with Python
https://www.youtube.com/playlist?list=PLE-8p-CwnFPta0COlxS6E5u14m5ouzbRU

15. Data Preprocessing in Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPuOjFcbnXLFvSQaHFK3ymUW

16. Sklearn Scikit Learn Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPtAGb29r8F7up9ilZUXt3l1

17. Linear Regression, Supervised Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPslDi6sfFbFK4KXcVlLwaOM

18 Interview Questions on Machine Learning, Artificial Intelligence, Python Pandas and Python Basics
https://www.youtube.com/playlist?list=PLE-8p-CwnFPt7VBhcnh82y0autSzuOrZp

19. Jupyter Notebook Operations
https://www.youtube.com/playlist?list=PLE-8p-CwnFPtqkFd67OZcoSv4BAI7ez5_

Рекомендуемые видео