결정 트리: 학습 내용 확인하기
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 페이지에서는 '학습 결정 트리' 단원에서 다룬 자료에 관한 일련의 객관식 연습문제에 답변해 보세요.
질문 1
숫자 특성을 음수 값으로 대체하면 (예: 값 +8을 -8로 변경) 정확한 숫자 스플리터를 사용했을 때 어떤 효과가 있나요?
동일한 조건이 학습되며 긍정/부정 하위 요소만 전환됩니다.
환상적입니다.
다른 조건이 학습되지만 결정 트리의 전체 구조는 동일하게 유지됩니다.
기능이 변경되면 조건도 변경됩니다.
결정 트리의 구조가 완전히 달라집니다.
결정 트리의 구조는 실제로 거의 동일합니다. 하지만 조건은 변경됩니다.
질문 2
X의 후보 임곗값 중 절반(무작위로 선택됨)만 테스트하는 효과를 가장 잘 설명하는 두 가지 답변은 무엇인가요?
정보 이득은 더 낮거나 같습니다.
잘하셨습니다.
최종 결정 트리의 테스트 정확성이 떨어집니다.
최종 결정 트리의 학습 정확도는 더 높지 않습니다.
잘하셨습니다.
질문 3
'정보 이득' 대 '기준점' 곡선에 여러 개의 국부 최대값이 있으면 어떻게 되나요?
로컬 최대값은 여러 개 있을 수 없습니다.
여러 개의 국소 최대값이 있을 수 있습니다.
알고리즘은 임곗값이 가장 작은 로컬 최대값을 선택합니다.
알고리즘은 전역 최대값을 선택합니다.
잘하셨습니다.
질문 4
다음 분할의 정보 이득을 계산합니다.
노드 | 긍정적인 예시 수 | 제외 예시 수 |
상위 노드 | 10 | 6 |
첫째 자녀 | 8 | 2 |
두 번째 자녀 | 2 | 4 |
아이콘을 클릭하여 답변을 확인합니다.
# Positive label distribution
p_parent = 10 / (10+6) # = 0.625
p_child_1 = 8 / (8+2) # = 0.8
p_child_2 = 2 / (2+4) # = 0.3333333
# Entropy
h_parent = -p_parent * log(p_parent) - (1-p_parent) * log(1-p_parent) # = 0.6615632
h_child_1 = ... # = 0.5004024
h_child_2 = ... # = 0.6365142
# Ratio of example in the child 1
s = (8+2)/(10+6)
f_final = s * h_child_1 + (1-s) * h_child_2 # = 0.5514443
information_gain = h_parent - f_final # = 0.1101189
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-02-25(UTC)
[null,null,["최종 업데이트: 2025-02-25(UTC)"],[[["\u003cp\u003eThis webpage presents a series of multiple-choice exercises focused on evaluating your understanding of decision tree training concepts.\u003c/p\u003e\n"],["\u003cp\u003eThe exercises cover topics such as the impact of feature manipulation on decision tree structure, the effects of altering threshold selection strategies, and the implications of multiple local maxima in information gain curves.\u003c/p\u003e\n"],["\u003cp\u003eOne question requires calculating information gain using entropy and provided data, demonstrating the practical application of decision tree principles.\u003c/p\u003e\n"]]],[],null,["# Decision trees: Check your understanding\n\n\u003cbr /\u003e\n\nThis page challenges you to answer a series of multiple choice exercises\nabout the material discussed in the \"Training Decision Trees\" unit.\n\nQuestion 1\n----------\n\nWhat are the effects of replacing the numerical features with their negative values (for example, changing the value +8 to -8) with the exact numerical splitter? \nThe same conditions will be learned; only the positive/negative children will be switched. \nFantastic. \nDifferent conditions will be learned, but the overall structure of the decision tree will remain the same. \nIf the features change, then the conditions will change. \nThe structure of the decision tree will be completely different. \nThe structure of the decision tree will actually be pretty much the same. The conditions will change, though.\n\nQuestion 2\n----------\n\nWhat two answers best describe the effect of testing only half (randomly selected) of the candidate threshold values in X? \nThe information gain would be higher or equal. \nThe information gain would be lower or equal. \nWell done. \nThe final decision tree would have worse testing accuracy. \nThe final decision tree would have no better training accuracy. \nWell done.\n\nQuestion 3\n----------\n\nWhat would happen if the \"information gain\" versus \"threshold\" curve had multiple local maxima? \nIt is impossible to have multiple local maxima. \nMultiple local maxima are possible. \nThe algorithm would select the local maxima with the smallest threshold value. \nThe algorithm would select the global maximum. \nWell done.\n\nQuestion 4\n----------\n\nCompute the information gain of the following split:\n\n| Node | # of positive examples | # of negative examples |\n|--------------|------------------------|------------------------|\n| parent node | 10 | 6 |\n| first child | 8 | 2 |\n| second child | 2 | 4 |\n\n#### Click the icon to see the answer.\n\n```scdoc\n# Positive label distribution\np_parent = 10 / (10+6) # = 0.625\np_child_1 = 8 / (8+2) # = 0.8\np_child_2 = 2 / (2+4) # = 0.3333333\n\n# Entropy\nh_parent = -p_parent * log(p_parent) - (1-p_parent) * log(1-p_parent) # = 0.6615632\nh_child_1 = ... # = 0.5004024\nh_child_2 = ... # = 0.6365142\n\n# Ratio of example in the child 1\ns = (8+2)/(10+6)\nf_final = s * h_child_1 + (1-s) * h_child_2 # = 0.5514443\n\ninformation_gain = h_parent - f_final # = 0.1101189\n```\n\n*** ** * ** ***"]]