# Decision Trees และ Ensembles (Data Science & ML) > Decision Trees, Random Forest, Gradient Boosting, XGBoost, การปรับ hyperparameter, feature importance - 24 คำถามสัมภาษณ์ - Mid-Level - [คำถามสัมภาษณ์: Data Science & ML](https://sharpskill.dev/th/technologies/data-science/interview-questions.md) ## 1. Decision tree ใน Machine Learning คืออะไร? **คำตอบ** Decision tree เป็นโมเดล Machine Learning ที่ทำการทำนายโดยการแบ่งข้อมูลตามกฎการตัดสินใจแบบลำดับชั้น แต่ละ internal node แสดงถึงการทดสอบบน feature แต่ละกิ่งแสดงถึงผลลัพธ์ของการทดสอบ และแต่ละ leaf แสดงถึงการทำนายขั้นสุดท้าย โมเดลนี้เข้าใจง่ายและตีความได้ง่าย ทำให้เป็นทางเลือกที่ดีเยี่ยมในการทำความเข้าใจปัจจัยที่มีอิทธิพลต่อการตัดสินใจ ## 2. เกณฑ์ใดถูกใช้เป็นค่าเริ่มต้นใน scikit-learn เพื่อวัดคุณภาพของ split ใน classification tree? **คำตอบ** Gini index คือเกณฑ์เริ่มต้นใน scikit-learn สำหรับ classification trees มันวัดความไม่บริสุทธิ์ของ node โดยการคำนวณความน่าจะเป็นที่องค์ประกอบจะถูกจัดประเภทผิดหากถูกจัดประเภทแบบสุ่มตามการกระจายของคลาส Gini เท่ากับ 0 หมายถึง node บริสุทธิ์ (คลาสเดียว) ในขณะที่ Gini สูงกว่าบ่งบอกถึงความหลากหลายของคลาสที่มากขึ้น ## 3. ความแตกต่างหลักระหว่าง Gini index และ entropy ในฐานะเกณฑ์ split คืออะไร? **คำตอบ** Gini index และ entropy โดยทั่วไปสร้าง tree ที่คล้ายกันมาก แต่ Gini คำนวณได้เร็วกว่าเล็กน้อยเนื่องจากไม่ต้องการการคำนวณ logarithm Entropy ซึ่งอิงตามทฤษฎีข้อมูล บางครั้งอาจสร้าง split ที่สมดุลมากขึ้นเล็กน้อย ในทางปฏิบัติ การเลือกระหว่างทั้งสองนี้ไม่ค่อยมีผลกระทบที่สำคัญต่อประสิทธิภาพของโมเดล ## มีอีก 21 คำถาม - Pruning ในบริบทของ decision trees คืออะไร? - Hyperparameter ใดควบคุมความลึกสูงสุดของ decision tree ใน scikit-learn? สมัครฟรี: https://sharpskill.dev/th/login ## หัวข้อสัมภาษณ์ Data Science & ML อื่นๆ - [พื้นฐาน Python](https://sharpskill.dev/th/technologies/data-science/interview-questions/python-basics.md): 25 คำถาม, Junior - [การเขียนโปรแกรมเชิงวัตถุด้วย Python](https://sharpskill.dev/th/technologies/data-science/interview-questions/python-oop.md): 20 คำถาม, Junior - [โครงสร้างข้อมูล Python](https://sharpskill.dev/th/technologies/data-science/interview-questions/python-data-structures.md): 20 คำถาม, Junior - [พื้นฐาน Git](https://sharpskill.dev/th/technologies/data-science/interview-questions/git-fundamentals.md): 18 คำถาม, Junior - [พื้นฐาน SQL](https://sharpskill.dev/th/technologies/data-science/interview-questions/sql-basics.md): 20 คำถาม, Junior - [พื้นฐาน NumPy](https://sharpskill.dev/th/technologies/data-science/interview-questions/numpy-fundamentals.md): 22 คำถาม, Junior - [พื้นฐาน Pandas](https://sharpskill.dev/th/technologies/data-science/interview-questions/pandas-basics.md): 22 คำถาม, Junior - [Jupyter & Google Colab](https://sharpskill.dev/th/technologies/data-science/interview-questions/jupyter-colab.md): 16 คำถาม, Junior - [SQL Joins และคิวรีขั้นสูง](https://sharpskill.dev/th/technologies/data-science/interview-questions/sql-joins-advanced.md): 22 คำถาม, Mid-Level - [Pandas ขั้นสูง](https://sharpskill.dev/th/technologies/data-science/interview-questions/pandas-advanced.md): 24 คำถาม, Mid-Level - [การแสดงผลข้อมูลด้วย Matplotlib & Seaborn](https://sharpskill.dev/th/technologies/data-science/interview-questions/matplotlib-seaborn.md): 20 คำถาม, Mid-Level - [การแสดงผลแบบโต้ตอบด้วย Plotly](https://sharpskill.dev/th/technologies/data-science/interview-questions/plotly-interactive.md): 18 คำถาม, Mid-Level - [สถิติเชิงพรรณนา](https://sharpskill.dev/th/technologies/data-science/interview-questions/statistics-descriptive.md): 20 คำถาม, Mid-Level - [สถิติเชิงอนุมาน](https://sharpskill.dev/th/technologies/data-science/interview-questions/statistics-inferential.md): 24 คำถาม, Mid-Level - [Web Scraping](https://sharpskill.dev/th/technologies/data-science/interview-questions/web-scraping.md): 18 คำถาม, Mid-Level - [BigQuery & Cloud Data](https://sharpskill.dev/th/technologies/data-science/interview-questions/bigquery-cloud.md): 18 คำถาม, Mid-Level - [Feature Engineering](https://sharpskill.dev/th/technologies/data-science/interview-questions/feature-engineering.md): 22 คำถาม, Mid-Level - [ML แบบมีผู้สอน: การถดถอย](https://sharpskill.dev/th/technologies/data-science/interview-questions/ml-supervised-regression.md): 24 คำถาม, Mid-Level - [ML แบบมีผู้สอน: การจำแนกประเภท](https://sharpskill.dev/th/technologies/data-science/interview-questions/ml-supervised-classification.md): 24 คำถาม, Mid-Level - [Unsupervised ML](https://sharpskill.dev/th/technologies/data-science/interview-questions/ml-unsupervised.md): 22 คำถาม, Mid-Level - [ML Pipelines และการตรวจสอบ](https://sharpskill.dev/th/technologies/data-science/interview-questions/ml-pipelines-validation.md): 22 คำถาม, Mid-Level - [Time Series และการพยากรณ์](https://sharpskill.dev/th/technologies/data-science/interview-questions/time-series-forecasting.md): 22 คำถาม, Mid-Level - [พื้นฐาน Deep Learning](https://sharpskill.dev/th/technologies/data-science/interview-questions/deep-learning-fundamentals.md): 24 คำถาม, Senior - [TensorFlow & Keras](https://sharpskill.dev/th/technologies/data-science/interview-questions/tensorflow-keras.md): 22 คำถาม, Senior - [CNN และการจำแนกภาพ](https://sharpskill.dev/th/technologies/data-science/interview-questions/cnn-image-classification.md): 24 คำถาม, Senior - [RNN และซีเควนซ์](https://sharpskill.dev/th/technologies/data-science/interview-questions/rnn-sequences.md): 22 คำถาม, Senior - [Transformers และ Attention](https://sharpskill.dev/th/technologies/data-science/interview-questions/transformers-attention.md): 24 คำถาม, Senior - [NLP และ Hugging Face](https://sharpskill.dev/th/technologies/data-science/interview-questions/nlp-huggingface.md): 24 คำถาม, Senior - [GenAI และ LangChain](https://sharpskill.dev/th/technologies/data-science/interview-questions/genai-langchain.md): 24 คำถาม, Senior - [MLOps และการ Deploy](https://sharpskill.dev/th/technologies/data-science/interview-questions/mlops-deployment.md): 24 คำถาม, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/th/technologies/data-science/interview-questions/ml-trees-ensembles