Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

parameters.py 905 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  1. def parameters(model_type):
  2. if model_type == 'random forest':
  3. param_grid = {
  4. 'classifier__estimator__n_estimators': [50, 100],
  5. 'classifier__estimator__max_features' :['sqrt', 'log2'],
  6. 'classifier__estimator__max_depth' : [4,6,8]
  7. }
  8. elif model_type == 'logistic regression':
  9. param_grid = {
  10. 'classifier__estimator__C': [0.1, 1.0, 10]
  11. }
  12. elif model_type == 'support vector machine':
  13. param_grid = {
  14. 'classifier__estimator__C': [0.1, 1.0, 10],
  15. 'classifier__estimator__kernel': ['linear'],
  16. 'classifier__estimator__probability': [True]
  17. }
  18. elif model_type == 'kneighbors':
  19. param_grid = {
  20. 'classifier__estimator__n_neighbors': [1, 3, 5],
  21. 'classifier__estimator__weights': ['uniform', 'distance']
  22. }
  23. return param_grid
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...