จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ความสำคัญของตัวแปร
ความสำคัญของตัวแปร (หรือที่เรียกว่าความสำคัญของฟีเจอร์) คือคะแนนที่บ่งบอกถึงความ "สำคัญ" ของฟีเจอร์ต่อโมเดล ตัวอย่างเช่น หากโมเดลหนึ่งๆ มีฟีเจอร์อินพุต 2 รายการ ได้แก่ "f1" และ "f2" และความสําคัญของตัวแปรคือ {f1=5.8, f2=2.5} แสดงว่าฟีเจอร์ "f1" "สําคัญ" ต่อโมเดลมากกว่าฟีเจอร์ "f2" ความสำคัญของตัวแปรเป็นวิธีง่ายๆ ในการทำความเข้าใจวิธีการทํางานของแผนภูมิการตัดสินใจเช่นเดียวกับโมเดลแมชชีนเลิร์นนิงอื่นๆ
คุณสามารถใช้ความสำคัญของตัวแปรที่ไม่ขึ้นอยู่กับโมเดล เช่น ความสำคัญของตัวแปรการสับเปลี่ยน กับต้นไม้การตัดสินใจได้
แผนภูมิการตัดสินใจยังมีความสำคัญของตัวแปรที่เฉพาะเจาะจง เช่น
- ผลรวมของคะแนนการแยกที่มีตัวแปรหนึ่งๆ
- จํานวนโหนดที่มีตัวแปรหนึ่งๆ
- ความลึกเฉลี่ยของการเกิดครั้งแรกขององค์ประกอบในเส้นทางต้นไม้ทั้งหมด
ความสำคัญของตัวแปรอาจแตกต่างกันไปตามคุณภาพ เช่น
- ความหมาย
- ปรับขนาด
- พร็อพเพอร์ตี้
นอกจากนี้ ความสําคัญของตัวแปรจะให้ข้อมูลประเภทต่างๆ เกี่ยวกับสิ่งต่อไปนี้
- โมเดล
- ชุดข้อมูล
- กระบวนการฝึกอบรม
เช่น จํานวนเงื่อนไขที่มีฟีเจอร์หนึ่งๆ บ่งบอกถึงระดับที่ต้นไม้การตัดสินใจพิจารณาฟีเจอร์หนึ่งๆ ซึ่งอาจบ่งบอกถึงความสําคัญของตัวแปร ท้ายที่สุดแล้ว อัลกอริทึมการเรียนรู้คงไม่ได้ใช้ฟีเจอร์ในหลายเงื่อนไขหากฟีเจอร์นั้นไม่สำคัญ อย่างไรก็ตาม ฟีเจอร์เดียวกันที่ปรากฏในหลายเงื่อนไขอาจบ่งชี้ว่าโมเดลพยายามสรุปรูปแบบของฟีเจอร์แต่ไม่สําเร็จ ตัวอย่างเช่น กรณีนี้อาจเกิดขึ้นเมื่อฟีเจอร์เป็นเพียงตัวระบุตัวอย่างที่ไม่มีข้อมูลทั่วไป
ในทางกลับกัน ค่าสูงสําหรับความสําคัญของตัวแปรการสับเปลี่ยนสูงบ่งชี้ว่าการนําฟีเจอร์ออกส่งผลเสียต่อโมเดล ซึ่งเป็นตัวบ่งชี้ความสําคัญของตัวแปร อย่างไรก็ตาม หากโมเดลมีประสิทธิภาพดี การนําฟีเจอร์ใดฟีเจอร์หนึ่งออกอาจไม่ส่งผลเสียต่อโมเดล
เนื่องจากความสำคัญของตัวแปรแต่ละรายการให้ข้อมูลเกี่ยวกับแง่มุมต่างๆ ของโมเดล การดูความสำคัญของตัวแปรหลายรายการพร้อมกันจึงให้ข้อมูล
เช่น หากฟีเจอร์หนึ่งมีความสําคัญตามความสําคัญของตัวแปรทั้งหมด ฟีเจอร์นี้ก็มีความสําคัญ อีกตัวอย่างหนึ่งคือ หากฟีเจอร์มี "จํานวนโหนด" ของตัวแปรที่มีความสําคัญสูงและ "การเปลี่ยนลําดับ" ของตัวแปรที่มีความสําคัญต่ำ ฟีเจอร์นี้อาจทําให้สรุปได้ยากและอาจทําให้คุณภาพโมเดลลดลง
ใน YDF คุณสามารถดูความสำคัญของตัวแปรของรูปแบบได้โดยเรียกใช้
model.describe()
แล้วดูแท็บ "ความสำคัญของตัวแปร"
ดูรายละเอียดเพิ่มเติมได้ใน
ตัวอย่างการทำความเข้าใจโมเดล
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-02-25 UTC
[null,null,["อัปเดตล่าสุด 2025-02-25 UTC"],[[["\u003cp\u003eVariable importance, also known as feature importance, is a score indicating how crucial a feature is to a model's predictions.\u003c/p\u003e\n"],["\u003cp\u003eDecision trees have specific variable importances like the sum of split scores, number of nodes using a variable, and average depth of a feature's first occurrence.\u003c/p\u003e\n"],["\u003cp\u003eDifferent variable importance metrics provide insights into the model, dataset, and training process, such as feature usage patterns and generalization abilities.\u003c/p\u003e\n"],["\u003cp\u003eExamining multiple variable importances together offers a comprehensive understanding of feature relevance and potential model weaknesses.\u003c/p\u003e\n"],["\u003cp\u003eYDF allows users to access variable importance through the \u003ccode\u003emodel.describe()\u003c/code\u003e function and its "variable importance" tab for model understanding.\u003c/p\u003e\n"]]],[],null,["\u003cbr /\u003e\n\nVariable importances\n--------------------\n\n**Variable importance** (also known as **feature importance**) is a score that\nindicates how \"important\" a feature is to the model. For example, if for a given\nmodel with two input features \"f1\" and \"f2\", the variable importances are\n{f1=5.8, f2=2.5}, then the feature \"f1\" is more \"important\" to the model than\nfeature \"f2\". As with other machine learning models, variable importance is a\nsimple way to understand how a decision tree works.\n\nYou can apply model agnostic variable importances such as [permutation variable\nimportances](/machine-learning/glossary#permutation-variable-importances),\nto decision trees.\n\nDecision trees also have specific variable importances, such as:\n\n- The sum of the split score with a given variable.\n- The number of nodes with a given variable.\n- The average depth of the first occurrence of a feature across all the tree paths.\n\nVariable importances can differ by qualities such as:\n\n- semantics\n- scale\n- properties\n\nFurthermore, variable importances provide different types of information about:\n\n- the model\n- the dataset\n- the training process\n\nFor example, the number of conditions containing a specific feature indicates\nhow much a decision tree is looking at this specific feature, which might\nindicate variable importance. After all, the learning algorithm would not have\nused a feature in multiple conditions if it did not matter. However, the same\nfeature appearing in multiple conditions might also indicate that a model is\ntrying but failing to generalize the pattern of a feature. For example, this\ncan happen when a feature is just an example identifier with no information\nto generalize.\n\nOn the other hand, a high value for a high permutation variable importance\nindicates that removing a feature hurts the model, which is an indication of\nvariable importance. However, if the model is robust, removing any one feature\nmight not hurt the model.\n\nBecause different variable importances inform about different aspects of the\nmodels, looking at several variable importances at the same time is informative.\nFor example, if a feature is important according to all the variable\nimportances, this feature is likely important. As another example, if a feature\nhas a high \"number of nodes\" variable importance and a small \"permutation\"\nvariable importance, then this feature might be hard to generalize and can\nhurt the model quality. \nYDF Code\nIn YDF, you can see the variable importance of a model by calling `model.describe()` and looking at the \"variable importance\" tab. See the [Model understanding tutorial](https://ydf.readthedocs.io/en/latest/tutorial/model_understanding) for more details."]]