Karar Ağaçları

Python ile Finans için Machine Learning

Nathan George

Data Science Professor

Karar ağaçları

temel karar ağacı

Python ile Finans için Machine Learning

Karar ağaçları

hedeflerle karar ağacı

Python ile Finans için Machine Learning

Karar ağacı bölünmeleri

kategorik karar ağacı bölünmesi

Python ile Finans için Machine Learning

Karar ağacı bölünmeleri

sayısal karar ağacı bölünmesi

Python ile Finans için Machine Learning

Kötü ağaç

kötü regresyon bölünmesi

Python ile Finans için Machine Learning

İyi ağaç

iyi regresyon bölünmesi

Python ile Finans için Machine Learning

Karar ağacı regresyonu

karar ağacı tahminleri

Python ile Finans için Machine Learning

Regresyon ağaçları

from sklearn.tree import DecisionTreeRegressor

decision_tree = DecisionTreeRegressor(max_depth=5)

decision_tree.fit(train_features, train_targets)
Python ile Finans için Machine Learning

Karar ağacı hiperparametreleri

ağaçların maksimum derinliği

Python ile Finans için Machine Learning

Maksimum derinlik: 3

maksimum derinliği 3 olan karar ağacı

Python ile Finans için Machine Learning

Modeli değerlendir

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 ile Finans için Machine Learning

tahminler vs gerçek değerler

Python ile Finans için Machine Learning

Biraz ağaç büyüt!

Python ile Finans için Machine Learning

Preparing Video For Download...