Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. `from sklearn import preprocessing
  2. le = preprocessing.LabelEncoder()
  3. for unique_hash in train.columns:
  4. if train[unique_hash].dtype == object:
  5. train[unique_hash] = le.fit_transform(train[unique_hash])
  6. else:
  7. pass`
  8.  
  9. `sent_classifier = DecisionTreeClassifier(max_leaf_nodes=10, random_state=0)
  10. sent_classifier.fit(X_train, y_train)`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement