با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
اهمیت های متغیر
اهمیت متغیر (همچنین به عنوان اهمیت ویژگی شناخته می شود) امتیازی است که نشان می دهد یک ویژگی برای مدل چقدر "مهم" است. به عنوان مثال، اگر برای یک مدل معین با دو ویژگی ورودی "f1" و "f2"، اهمیت متغیرها {f1=5.8، f2=2.5} باشد، آنگاه ویژگی "f1" برای مدل از ویژگی "f2" مهمتر است. مانند سایر مدلهای یادگیری ماشین، اهمیت متغیر یک راه ساده برای درک نحوه عملکرد درخت تصمیم است.
شما می توانید اهمیت متغیرهای آگنوستیک مدل مانند اهمیت متغیرهای جایگشتی را برای درختان تصمیم اعمال کنید.
درختان تصمیم نیز دارای اهمیت متغیر خاصی هستند، مانند:
- مجموع نمره تقسیم با یک متغیر معین.
- تعداد گره ها با یک متغیر معین.
- میانگین عمق اولین وقوع یک ویژگی در تمام مسیرهای درختی.
اهمیت متغیر می تواند با کیفیت هایی مانند:
علاوه بر این، اهمیت متغیر انواع مختلفی از اطلاعات را در مورد:
- مدل
- مجموعه داده
- روند آموزش
به عنوان مثال، تعداد شرایط حاوی یک ویژگی خاص نشان می دهد که درخت تصمیم چقدر به این ویژگی خاص نگاه می کند، که ممکن است نشان دهنده اهمیت متغیر باشد. به هر حال، الگوریتم یادگیری اگر مهم نبود از یک ویژگی در شرایط چندگانه استفاده نمی کرد. با این حال، همان ویژگی که در شرایط چندگانه ظاهر میشود ممکن است نشاندهنده این باشد که یک مدل تلاش میکند، اما در تعمیم الگوی یک ویژگی ناکام است. به عنوان مثال، این می تواند زمانی اتفاق بیفتد که یک ویژگی فقط یک شناسه نمونه باشد که هیچ اطلاعاتی برای تعمیم ندارد.
از سوی دیگر، یک مقدار بالا برای اهمیت متغیر جایگشت بالا نشان میدهد که حذف یک ویژگی به مدل آسیب میزند، که نشانهای از اهمیت متغیر است. با این حال، اگر مدل قوی باشد، حذف هر یک از ویژگیها ممکن است به مدل آسیبی نرساند.
از آنجایی که اهمیت متغیرهای مختلف در مورد جنبههای مختلف مدلها اطلاعات میدهد، نگاه کردن به چندین اهمیت متغیر به طور همزمان آموزنده است. به عنوان مثال، اگر یک ویژگی با توجه به همه اهمیت های متغیر مهم باشد، این ویژگی احتمالا مهم است. به عنوان مثال دیگر، اگر یک ویژگی دارای اهمیت متغیر "تعداد گره" بالا و اهمیت متغیر "جایگشت" کوچک باشد، تعمیم این ویژگی ممکن است سخت باشد و به کیفیت مدل آسیب برساند.
در YDF، می توانید با فراخوانی
model.describe()
و نگاه کردن به تب "variable important" اهمیت متغیر یک مدل را ببینید. برای جزئیات بیشتر به
آموزش درک مدل مراجعه کنید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-02-25 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-02-25 بهوقت ساعت هماهنگ جهانی."],[[["\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."]]