Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for depth in range(1, 6):
- model = DecisionTreeClassifier(random_state=12345, max_depth=depth)
- model.fit(features_train, target_train)
- predictions_valid = model.predict(features_valid)
- print("max_depth =", depth, ": ", end='')
- print(accuracy_score(target_valid, predictions_valid))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement