Close Menu
    Trending
    • The Hidden Risk That Crashes Startups — Even the Profitable Ones
    • Systematic Hedging Of An Equity Portfolio With Short-Selling Strategies Based On The VIX | by Domenico D’Errico | Jun, 2025
    • AMD CEO Claims New AI Chips ‘Outperform’ Nvidia’s
    • How AI Agents “Talk” to Each Other
    • Creating Smart Forms with Auto-Complete and Validation using AI | by Seungchul Jeff Ha | Jun, 2025
    • Why Knowing Your Customer Drives Smarter Growth (and Higher Profits)
    • Stop Building AI Platforms | Towards Data Science
    • What If Your Portfolio Could Speak for You? | by Lusha Wang | Jun, 2025
    Finance StarGate
    • Home
    • Artificial Intelligence
    • AI Technology
    • Data Science
    • Machine Learning
    • Finance
    • Passive Income
    Finance StarGate
    Home»Machine Learning»Decision Tree Models | Part 2. Basic of tree, Random Forest, Gradient… | by Wichada Chaiprasertsud | Feb, 2025
    Machine Learning

    Decision Tree Models | Part 2. Basic of tree, Random Forest, Gradient… | by Wichada Chaiprasertsud | Feb, 2025

    FinanceStarGateBy FinanceStarGateFebruary 5, 2025No Comments3 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    Share
    Facebook Twitter LinkedIn Pinterest Email


    Fundamental of tree, Random Forest, Gradient Boosting Tree & XGBoost, and so forth.

    Earlier:

    ในตอนที่แล้วเราได้พูดถึง Determination Tree ปกติไป คราวนี้เราจะมาพูดถึง Determination Tree ที่ถูกพัฒนาเพื่อแก้ไขปัญหาบางอย่าง

    https://slideplayer.com/slide/7029806/ Zhangxi Lin ISQS Texas Tech University Note

    Determination Tree มีความ unstable สูงมาก ๆ การเปลี่ยนแปลงแค่นิดเดียว หรือเพียงแค่ข้อมูลเดียวเหมือนดังรูป อาจทำให้เราได้ Tree ที่มี construction เปลี่ยนไปโดยสิ้นเชิง

    เราจึงจะแก้ไขปัญหานี้โดยการใช้ method — ensemble mannequin หรือ mannequin ที่เป็น mixture ของ mannequin หลาย ๆ อัน ซึ่งก็มีหลายวิธี เช่น

    • Bagging ซึ่งเป็นการ practice mannequin หลาย ๆ ตัวแยกกันแบบ parallel แล้วเอาผลมา mix
    • Boosting ซึ่งเป็นการ practice mannequin หลาย ๆ ตัวต่อกัน แบบ sequentially แล้วให้ mannequin ตัวหลังมาแก้ error ของ mannequin ตัวก่อนหน้า

    กลายเป็น mannequin ที่ถูกพัฒนาต่อมา ไม่ว่าจะเป็น

    ปัจจุบันไม่ค่อยนิยมแล้ว เพราะคนไปใช้ Random Forest ซึ่งเป็นเวอร์ชันที่ถูกพัฒนาจาก Bagging

    https://www.analyticsvidhya.com/blog/2023/01/ensemble-learning-methods-bagging-boosting-and-stacking/

    Take Majority Vote(Common) of Prediction

    enhanced Bagging, Bagging + random characteristic choice for every cut up. Enhance robustness and scale back overfitting

    machine learning — What is the difference between bagging and random forest if only one explanatory variable is used? — Cross Validated

    Many timber → Forest!

    Forest takes bootstrap samples of the rows in coaching information (sampling with substitute; after chosen we put it again to the pool, so it may be chosen once more) then at every step, a set of variables (columns) is sampled.

    โดยค่าของ max options หรือ max samples รวมถึง จำนวนต้นไม้ใน RF เราสามารถกำหนดได้

    Execs: คำนวณง่าย คำนวณได้แบบ parallel เป็น robust baseline

    Cons: ด้วยความที่ mannequin advanced ขึ้น เราอาจจะตีความผลจากต้นไม้ได้ยาก เพราะผลมาจากต้นไม้หลายต้นเฉลี่ยกัน

    ปัจจุบันไม่ค่อยนิยมแล้ว เพราะคนไปใช้ Gradient Boosting ซึ่งเป็นเวอร์ชันที่ถูกพัฒนาจาก Boosting

    https://www.almabetter.com/bytes/tutorials/data-science/adaboost-algorithm
    https://medium.com/towards-data-science/the-ultimate-guide-to-adaboost-random-forests-and-xgboost-7f9327061c4f
    • Focuses on re-weighting misclassified samples.
    • Every weak learner is educated sequentially, with extra weight given to incorrectly categorised factors.
    • The ultimate mannequin is a weighted sum of weak learners. Fashions that carry out higher get greater weight.

    สังเกตได้ว่ากระบวนการแบบนี้จะทำให้ Outlier มีผลกับ mannequin มาก ๆ เพราะจะได้ weight ที่เพิ่มขึ้น

    ใช้หลักการ Boosting เหมือนกัน แต่เป้าหมายของต้นไม้ตัวถัดไปคือ การทำนาย Error ไม่ใช่ Goal!

    prediction outcome = summation of all timber (not common as RF any extra)

    Preliminary Prediction
    ค่า Preliminary Prediction มักจะเป็นค่าจากโมเดลง่าย ๆ เช่น:

    • ค่าเฉลี่ย (Imply) ของ yy สำหรับปัญหาการพยากรณ์แบบ Regression
    • ค่า Log-Odds ของ Class Prior สำหรับ Classification
    • ตัวอย่างเช่น ในปัญหาการทำนายราคา ถ้าค่าเฉลี่ยของราคาบ้านคือ 3 ล้าน บาท ค่าเริ่มต้นของโมเดลก็จะเป็น 3 ล้านบาททุกตัวอย่าง

    Prediction

    • Residuals/Error เป็นค่าที่โมเดลถัดไปจะเรียนรู้
    • เช่นค่า +0.95 หรือ -0.44 ในรูป
    • เมื่อโมเดลแรกทำนายออกมา ค่า Residual (ri = yi — f0(xi)) จะกลายเป็น goal ใหม่ ที่โมเดลถัดไปต้องเรียนรู้
    • ตัวอย่าง:
    • ถ้าเราทำนายราคาบ้านได้ 2.5 ล้าน แต่ความจริงคือ 3 ล้าน, Residual คือ +0.5 ล้าน
    • โมเดลต้นไม้ต้นต่อไปจะพยายามพยากรณ์ +0.5 ล้าน (ค่าความผิดพลาดที่เหลืออยู่)

    การใช้ Gradient Descent Studying Fee (η) เพื่อป้องกัน Overfitting

    • การเพิ่มผลรวมของต้นไม้แต่ละต้นไม่ได้เกิดขึ้นแบบ 100% แต่ถูกปรับด้วยค่าที่เรียกว่า Studying Fee (η) ของ GD
    • ค่า η ควบคุมว่าโมเดลต้นไม้ใหม่จะมีอิทธิพลต่อผลลัพธ์สุดท้ายแค่ไหน
    • ค่า η ต่ำ (เช่น 0.1) → โมเดลเรียนช้าลง แต่ลด Overfitting
    • ค่า η สูง (เช่น 1.0) → โมเดลอัปเดตเร็วขึ้น แต่เสี่ยง Overfitting

    Mannequin สุดท้ายเป็นการรวมค่าทั้งหมด (Ensemble Mannequin)

    • ผลลัพธ์สุดท้ายไม่ได้มาจากต้นไม้ต้นเดียว แต่เป็น การรวมกันของต้นไม้หลายต้น
    • สมการของโมเดลสุดท้ายคือ
    • ซึ่งหมายความว่าแต่ละต้นไม้ช่วยกันลดข้อผิดพลาดทีละน้อย ทำให้ผลลัพธ์สุดท้ายแม่นยำขึ้น

    เมื่อเราได้ Error แล้ว สังเกตได้ว่า Error แต่ละค่าจะมีค่า weight ที่คูณอยู่ ซึ่งนั่นคือการที่เราจะหา weight ที่ดีที่สุดโดยการใช้ GD Gradient Descent

    “Optimize weight of leaf nodes by gradient descent Authentic Tree”

    ทำให้บน mannequin สามารถปรับ studying charge สำหรับ GD ได้ด้วยนั่นเอง

    Mannequin ที่ให้ผลใกล้เคียงกับ XGBoost แต่เร็วกว่ามาก

    เป็นการปรับปรุง GBM โดยเพิ่ม

    • Regularization (มี L1 (Lasso) และ L2 (Ridge) ทำให้ลด Overfitting ได้ดีขึ้น)
    • Parallelization มีการคำนวณแบบ Parallel และ Optimized Reminiscence Utilization
    • Pruning ใช้วิธี “Loss-based Pruning”
    • จัดการ Lacking Values ได้อัตโนมัติ และอื่น ๆ

    รวมถึงหนึ่งใน key สำคัญคือการใช้ Approximate Tree Studying

    Approximate Tree Studying

    ปัญหาของ Gradient Boosting ปกติคือ การแบ่งโหนด (Splitting) ของต้นไม้ต้อง Kind ค่า Characteristic ทุกครั้ง → ทำให้ใช้เวลานานมาก ส่งผลให้

    • การหาจุดแบ่ง (Finest Break up) เป็นกระบวนการที่มีค่าใช้จ่ายสูง (Computational Value สูง)

    XGBoost แก้ปัญหานี้ด้วย Approximate Splitting

    • แทนที่จะ Kind ทุกค่า ในแต่ละรอบ XGBoost ใช้วิธี Approximate Algorithm ที่เป็น Grasping operate
    • โดยการ แบ่ง Characteristic เป็น Quantile Sketch (Bucket-based) → ลดการคำนวณ
    • ทำให้การตัดสินใจเลือก Break up Level เร็วขึ้น อาจมีการเลือก Break up Level ที่ไม่แม่นยำที่สุดในบางกรณี แต่โดยรวมแล้วยังได้ผลลัพธ์ที่ดีและเร็วขึ้นมาก

    *XGBoost package deal ไม่อยู่ใน sklearn

    https://towardsmachinelearning.org/boosting-algorithms/
    https://www.researchgate.net/figure/Evolution-of-XGBoost-Algorithm-from-Decision-Trees-34_fig2_352693260

    Examples of Determination Tree Fashions, Their Capabilities, and Libraries

    https://github.com/pvateekul/2110446_DSDE_2024s2 by รศ.ดร.พีรพล เวทีกูล (Assoc. Prof. Peerapon Vateekul, Ph.D.)



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleEntrepreneurs Drive the Economy — But Are We Doing Enough to Support Them?
    Next Article Customer spotlight: Personify Health’s thoughtful approach to AI adoption
    FinanceStarGate

    Related Posts

    Machine Learning

    Systematic Hedging Of An Equity Portfolio With Short-Selling Strategies Based On The VIX | by Domenico D’Errico | Jun, 2025

    June 14, 2025
    Machine Learning

    Creating Smart Forms with Auto-Complete and Validation using AI | by Seungchul Jeff Ha | Jun, 2025

    June 14, 2025
    Machine Learning

    What If Your Portfolio Could Speak for You? | by Lusha Wang | Jun, 2025

    June 14, 2025
    Add A Comment

    Comments are closed.

    Top Posts

    Komprise Unveils Sensitive Data Management for AI Data Governance and Cybersecurity

    February 2, 2025

    How Zooey Deschanel is on a Mission to Make Fresh Produce Accessible

    February 16, 2025

    5 Ways SMEs Can Start Their Digital Transformation Journey Today

    March 18, 2025

    Making Sense of CNNs: Breaking Down the Core Concepts | by Weronika Wojtak, PhD | May, 2025

    May 27, 2025

    ALL-IN-ONE Agent — Manus?. Alright! Let’s chat about something… | by Kaushik Holla | Mar, 2025

    March 13, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Data Science
    • Finance
    • Machine Learning
    • Passive Income
    Most Popular

    The Workday Is Shorter, But Productivity Is Up: New Study

    March 18, 2025

    Photonic Fabric: Celestial AI Secures $250M Series C Funding

    March 12, 2025

    ‘Task Masking’: How Employees Retaliate Against RTO Mandates

    February 19, 2025
    Our Picks

    CoreWeave Completes Acquisition of Weights & Biases

    May 7, 2025

    How I Trained a Machine Learning Model to Predict Car Prices (And How You Can Too) | by Ishan Shrestha | May, 2025

    May 16, 2025

    4 Ways to Help Your Entry-Level Hires Thrive in the Workplace

    March 27, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Data Science
    • Finance
    • Machine Learning
    • Passive Income
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us
    Copyright © 2025 Financestargate.com All Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.