의사결정 트리

Python으로 배우는 금융 분야 Machine Learning

Nathan George

Data Science Professor

의사결정 트리

기본 의사결정 트리

Python으로 배우는 금융 분야 Machine Learning

의사결정 트리

타겟이 있는 의사결정 트리

Python으로 배우는 금융 분야 Machine Learning

의사결정 트리 분할

범주형 의사결정 트리 분할

Python으로 배우는 금융 분야 Machine Learning

의사결정 트리 분할

수치형 의사결정 트리 분할

Python으로 배우는 금융 분야 Machine Learning

나쁜 트리

나쁜 회귀 분할

Python으로 배우는 금융 분야 Machine Learning

좋은 트리

좋은 회귀 분할

Python으로 배우는 금융 분야 Machine Learning

의사결정 트리 회귀

의사결정 트리 예측

Python으로 배우는 금융 분야 Machine Learning

회귀 트리

from sklearn.tree import DecisionTreeRegressor

decision_tree = DecisionTreeRegressor(max_depth=5)

decision_tree.fit(train_features, train_targets)
Python으로 배우는 금융 분야 Machine Learning

의사결정 트리 하이퍼파라미터

트리의 최대 깊이

Python으로 배우는 금융 분야 Machine Learning

최대 깊이 3

최대 깊이 3의 의사결정 트리

Python으로 배우는 금융 분야 Machine Learning

모델 평가

print(decision_tree.score(train_features, train_targets))
print(decision_tree.score(test_features, test_targets))
0.6662215501032416
-0.08917300191734268
train_predictions = decision_tree.predict(train_features)
test_predictions = decision_tree.predict(test_features)
plt.scatter(train_predictions, train_targets, label='train')
plt.scatter(test_predictions, test_targets, label='test')
plt.legend()
plt.show()
Python으로 배우는 금융 분야 Machine Learning

예측값 vs 실제값

Python으로 배우는 금융 분야 Machine Learning

트리를 키워 봅시다!

Python으로 배우는 금융 분야 Machine Learning

Preparing Video For Download...