컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
변수 중요도
변수 중요도 (특성 중요도라고도 함)는 특성이 모델에 얼마나 '중요'한지 나타내는 점수입니다. 예를 들어 입력 특성 'f1'과 'f2'가 2개인 지정된 모델의 변수 중요도가 {f1=5.8, f2=2.5}이면 특성 'f1'이 특성 'f2'보다 모델에 더 '중요'합니다. 다른 머신러닝 모델과 마찬가지로 변수 중요도는 결정 트리의 작동 방식을 이해하는 간단한 방법입니다.
순열 변수 중요도와 같은 모델 독립적 변수 중요도를 결정 트리에 적용할 수 있습니다.
결정 트리에는 다음과 같은 특정 변수 중요도도 있습니다.
- 지정된 변수의 분할 점수의 합계입니다.
- 지정된 변수가 있는 노드의 수입니다.
- 모든 트리 경로에서 지형지물이 처음 발생하는 평균 깊이입니다.
변수 중요도는 다음과 같은 품질에 따라 다를 수 있습니다.
또한 변수 중요도는 다음에 관한 다양한 유형의 정보를 제공합니다.
예를 들어 특정 기능이 포함된 조건의 수는 결정 트리가 이 특정 기능을 얼마나 많이 보고 있는지를 나타내며 이는 변수 중요성을 나타낼 수 있습니다. 결국 학습 알고리즘은 중요하지 않은 경우 여러 조건에서 기능을 사용하지 않았을 것입니다. 그러나 여러 조건에 동일한 기능이 표시되면 모델이 기능의 패턴을 일반화하려고 시도했지만 실패했음을 나타낼 수도 있습니다. 예를 들어 지형지물이 일반화할 정보가 없는 예시 식별자일 때 이러한 상황이 발생할 수 있습니다.
반면에 순열 변수 중요도가 높으면 특성을 삭제하면 모델이 손상된다는 의미이며 이는 변수 중요도를 나타냅니다. 하지만 모델이 강력하다면 특성 하나를 삭제해도 모델에 영향을 미치지 않을 수 있습니다.
변수 중요도는 모델의 다양한 측면을 알려주므로 여러 변수 중요도를 동시에 확인하면 유용한 정보를 얻을 수 있습니다.
예를 들어 모든 변수 중요도에 따라 특성이 중요하다면 이 특성은 중요할 가능성이 높습니다. 또 다른 예로 특성에 '노드 수' 변수 중요도가 높고 '순열' 변수 중요도가 낮은 경우 이 특성을 일반화하기 어려울 수 있으며 모델 품질이 저하될 수 있습니다.
YDF에서
model.describe()
를 호출하고 '변수 중요도' 탭을 보면 모델의 변수 중요도를 확인할 수 있습니다.
자세한 내용은
모델 이해 튜토리얼을 참고하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 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."]]