Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| st.set_page_config(page_title="Decision Tree", page_icon="✨", layout="wide") | |
| st.markdown("<h1 style='color: #003366;'>Understanding Decision Tree</h1>", unsafe_allow_html=True) | |
| st.image("https://cdn-uploads.huggingface.co/production/uploads/673f6e448c5214b832b3724c/zcCYCBE0x2U-nrPU5hBqc.png") | |
| # Introduction | |
| st.write(""" | |
| - A Decision Tree is a popular and powerful supervised machine learning algorithm used for both classification and regression tasks. | |
| - It models decisions and their possible consequences as a tree-like structure, similar to a flowchart. | |
| - In a decision tree, data is split into smaller subsets based on certain conditions (called features), and this process continues recursively, forming a tree with nodes (where decisions are made) and leaves (which represent the final output or decision). | |
| """) | |
| st.markdown("<h2 style='color: #003366;'>How Decision Tree Works</h2>", unsafe_allow_html=True) | |
| st.subheader("Training Phase") | |
| st.write(""" | |
| - Training a decision tree involves building the tree structure by splitting the dataset into subsets based on feature values, with the goal of minimizing uncertainty or impurity at each step. | |
| - Start at the root node with the full training dataset. | |
| - Choose the best feature to split the data. This is done using a criterion like: | |
| - Gini Impurity (used in classification) | |
| - Entropy / Information Gain (used in classification) | |
| - Mean Squared Error (MSE) (used in regression) | |
| - Split the dataset based on the selected feature's values. | |
| - Repeat the process recursively for each child node, until: | |
| - A stopping condition is met (like max depth or minimum samples per leaf), or The node is pure (all data points have the same label). | |
| """) | |