Spaces:
Sleeping
Sleeping
File size: 1,749 Bytes
fc4f4a7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | 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).
""")
|