Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #the model.predict_proba is turned into a dataframe to make it more accessible
  2.  
  3. #train the model
  4. X_train, X_test, y_train, y_test = train_test_split(X, Y, test_size = 0.2, random_state = 263)
  5.  
  6. #test the model
  7. model = tree.DecisionTreeClassifier()
  8. model.fit(X_train, y_train)
  9. df2 = pd.DataFrame(model.predict_proba(X_test))
  10. model.score(X_test, y_test)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement