Advertisement
Guest User

Untitled

a guest
Jun 25th, 2018
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.03 KB | None | 0 0
  1. TypeError                                 Traceback (most recent call last)
  2. <ipython-input-5-1c9458ca74a8> in <module>()
  3.       8                               scoring='accuracy', cv=10, n_jobs=-1,
  4.       9                               random_state=0)
  5. ---> 10 randomcv.fit(x_tu, y_tu)
  6.  
  7. ~\Anaconda3\lib\site-packages\sklearn\model_selection\_search.py in fit(self, X, y, groups, **fit_params)
  8.     616         n_splits = cv.get_n_splits(X, y, groups)
  9.     617         # Regenerate parameter iterable for each fit
  10. --> 618         candidate_params = list(self._get_param_iterator())
  11.     619         n_candidates = len(candidate_params)
  12.     620         if self.verbose > 0:
  13.  
  14. ~\Anaconda3\lib\site-packages\sklearn\model_selection\_search.py in __iter__(self)
  15.     242             # look up sampled parameter settings in parameter grid
  16.     243             param_grid = ParameterGrid(self.param_distributions)
  17. --> 244             grid_size = len(param_grid)
  18.     245
  19.     246             if grid_size < self.n_iter:
  20.  
  21. ~\Anaconda3\lib\site-packages\sklearn\model_selection\_search.py in __len__(self)
  22.     122         product = partial(reduce, operator.mul)
  23.     123         return sum(product(len(v) for v in p.values()) if p else 1
  24. --> 124                    for p in self.param_grid)
  25.     125
  26.     126     def __getitem__(self, ind):
  27.  
  28. ~\Anaconda3\lib\site-packages\sklearn\model_selection\_search.py in <genexpr>(.0)
  29.     122         product = partial(reduce, operator.mul)
  30.     123         return sum(product(len(v) for v in p.values()) if p else 1
  31. --> 124                    for p in self.param_grid)
  32.     125
  33.     126     def __getitem__(self, ind):
  34.  
  35. ~\Anaconda3\lib\site-packages\sklearn\model_selection\_search.py in <genexpr>(.0)
  36.     121         # Product function that can handle iterables (np.product can't).
  37.     122         product = partial(reduce, operator.mul)
  38. --> 123         return sum(product(len(v) for v in p.values()) if p else 1
  39.     124                    for p in self.param_grid)
  40.     125
  41.  
  42. TypeError: object of type 'int' has no len()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement