<jupyter_start><jupyter_text>ডিসিশন ট্রি হাতেকলমে দেখা লাইব্রেরি ইম্পোর্ট করছি<jupyter_code>from matplotlib import pyplot as plt
from sklearn import datasets
from sklearn.tree import DecisionTreeClassifier 
from sklearn import tree<jupyter_output><empty_output><jupyter_text>ডাটাকে তৈরি করছি<jupyter_code>iris = datasets.load_iris()
X = iris.data
y = iris.target<jupyter_output><empty_output><jupyter_text>ক্লাসিফায়ারকে ফিট করছি ডিফল্ট হাইপার প্যারামিটার দিয়ে<jupyter_code>clf = DecisionTreeClassifier(random_state=1234)
model = clf.fit(X, y)<jupyter_output><empty_output><jupyter_text>ডিসিশন ট্রি প্লট করে দেখা<jupyter_code>import graphviz

dot_data = tree.export_graphviz(clf, out_file=None, 
                                feature_names=iris.feature_names,  
                                class_names=iris.target_names,
                                filled=True)<jupyter_output><empty_output><jupyter_text>গ্রাফ আঁকি<jupyter_code>graph = graphviz.Source(dot_data, format="png") 
graph
dot_data = tree.export_graphviz(clf, out_file=None, 
                     feature_names=iris.feature_names,  
                      class_names=iris.target_names,  
                      filled=True, rounded=True,  
                      special_characters=True)  
graph = graphviz.Source(dot_data)  
graph<jupyter_output><empty_output><jupyter_text>ডিসিশন ট্রি একদম ভেতর থেকে দেখা<jupyter_code># !pip install dtreeviz
import warnings
warnings.filterwarnings('ignore')

from dtreeviz.trees import dtreeviz 

viz = dtreeviz(clf, X, y,
                target_name="target",
                feature_names=iris.feature_names,
                class_names=list(iris.target_names))
viz<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11757789535567313, 'fraction_numerical': 0.0023515579071134627, 'mean_word_length': 3.625, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '76062', 'license': 'MIT', 'n_tokens_mistral': 748, 'n_tokens_neox': 759, 'n_words': 90, 'path': 'decision_tree_test.ipynb', 'repo_name': 'shauravmahmud/data_analyst', 'size': '1701'}