<jupyter_start><jupyter_text>Decision Tree----Decision trees are a classifier in machine learning that allows us to make predictions based on previous data. They are like a series of sequential “if … then” statements you feed new data into to get a result. **Entropy :** Entropy controls how a Decision Tree decides to split the data. In a decision tree our goal is to pick a decicion node whose entropy is minimum. The formula of entropy is *entropy=−p1​log2​(p1​)−p2​log2​(p2​)−…−pn​log2​(pn​)=−i=1∑n​pi​log2​(pi​)***Gain:** Gain is the differrence between the entropy of data before partition and after partition.*Gain = Entropy(Parent)−(Entropy(Child1)+​Entropy(Child2))*<jupyter_code>from IPython.display import Image 
Image(filename='../img/entropy.jpg', width=600, height=500)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11562115621156212, 'fraction_numerical': 0.020910209102091022, 'mean_word_length': 6.267857142857143, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '126144', 'license': 'MIT', 'n_tokens_mistral': 262, 'n_tokens_neox': 250, 'n_words': 94, 'path': 'Jupyter-Notebook/Decision-Tree/Decision Tree .ipynb', 'repo_name': 'shohan4556/machine-learning-course-notes', 'size': '813'}