コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
変数の重要度
変数の重要度(特徴量の重要度)は、モデルに対する特徴量の「重要度」を示すスコアです。たとえば、2 つの入力特徴量「f1」と「f2」を持つ特定のモデルで、変数の重要度が {f1=5.8, f2=2.5} の場合、特徴量「f1」は特徴量「f2」よりもモデルにとって「重要」です。他の ML モデルと同様に、変数の重要度は、決定木の仕組みを理解するための簡単な方法です。
順列変数の重要度など、モデルに依存しない変数の重要度を決定木に適用できます。
デシジョン ツリーには、次のような特定の変数の重要度もあります。
- 特定の変数を使用した分割スコアの合計。
- 特定の変数を持つノードの数。
- すべてのツリーパス全体で特徴が最初に出現する深さの平均。
変数の重要度は、次のような品質によって異なる場合があります。
- セマンティクス
- WAF によるメリット
- プロパティ
さらに、変数の重要度では、次のようなさまざまな種類の情報が得られます。
たとえば、特定の特徴を含む条件の数は、ディシジョン ツリーがこの特定の特徴をどの程度考慮しているかを示します。これは変数の重要性を示す場合があります。結局のところ、重要でない場合は、学習アルゴリズムは複数の条件で特徴を使用しません。ただし、同じ特徴が複数の条件に表示される場合、モデルが特徴のパターンを一般化しようとしているが失敗していることも示唆されます。たとえば、特徴が一般化できる情報がなく、単なるサンプル ID である場合に、この問題が発生することがあります。
一方、並べ替え変数の重要度が高い場合、値が高いほど特徴量を削除するとモデルの性能が低下することを示します。これは変数の重要度を示しています。ただし、モデルが堅牢な場合、1 つの特徴を削除してもモデルに影響しない可能性があります。
変数の重要度はモデルのさまざまな側面を示しているため、複数の変数の重要度を同時に確認すると有益です。たとえば、すべての変数の重要度に従って特徴が重要である場合、この特徴は重要である可能性が高いです。別の例として、特徴量の「ノード数」変数の重要度が高く、「並べ替え」変数の重要度が低い場合、この特徴量は一般化が難しく、モデルの品質が低下する可能性があります。
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."]]