Advertisement
Guest User

feature selection

a guest
Jun 20th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.79 KB | None | 0 0
  1. tele_class = tele['label'].values
  2.  
  3. pd.isnull(tele).any()
  4.  
  5. from sklearn.model_selection import train_test_split
  6.  
  7. # from sklearn.cross_validation import train_test_split
  8. training_indices, validation_indices = training_indices, testing_indices = train_test_split(tele.index,
  9.                                                                                             stratify = tele_class,
  10.                                                                                             train_size=0.75, test_size=0.25)
  11. training_indices.size, validation_indices.size  
  12.  
  13.  
  14. from tpot import TPOTClassifier
  15. from tpot import TPOTRegressor
  16.  
  17. tpot = TPOTClassifier(generations=5, verbosity=2)
  18.  
  19. tpot.fit(tele.drop('label',axis=1).loc[training_indices].values,
  20.          tele.loc[training_indices,'label'].values)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement