Guest User

Untitled

a guest
May 23rd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. Column A Column B AnnualFee ColumnD ColumnE
  2. 4500 3.9 5% 2.1 7
  3. 4500 3.9 10% 2.1 7
  4. 4500 3.9 15% 2.1 7
  5. 4500 3.9 20% 2.1 7
  6. 4500 3.9 25% 2.1 7
  7.  
  8. rf = RandomForestClassifier(n_estimators = 400,random_state = 0,
  9. min_samples_split=2,min_samples_leaf=5,
  10. class_weight = {0:.0001,1:.9999})
  11. rf.fit(X_train, Y_train )
  12.  
  13. from sklearn.model_selection import StratifiedKFold
  14. from sklearn.model_selection import GridSearchCV
  15. clf_4 = RandomForestClassifier(class_weight = {0:1,1:5})
  16. estimators_range = np.array([2,3,4,5,6,7,8,9,10,15,20,25])
  17. depth_range = np.array([11,21,35,51,75,101,151,201,251,301,401,451,501])
  18. kfold = 5
  19. skf = StratifiedKFold(n_splits = kfold,random_state = 42)
  20.  
  21. model_grid = [{'max_depth': depth_range, 'n_estimators': estimators_range}]
  22. grid = GridSearchCV(clf_4, model_grid, cv = StratifiedKFold(n_splits = 5,
  23. random_state = 42),n_jobs = 8, scoring = 'roc_auc')
  24. grid.fit(X_train,Y_train)
Add Comment
Please, Sign In to add comment