在运行gridSearch时出错,一堆报错内容看不太懂…
UnicodeEncodeError Traceback (most recent call last)
<ipython-input-12-94e3e7f4c057> in <module>
15 knn_reg = KNeighborsRegressor()
16 grid_search = GridSearchCV(knn_reg, param_grid, n_jobs=-1, verbose=1)
---> 17 grid_search.fit(X_train_standard, y_train)
C:\anaconda\lib\site-packages\sklearn\model_selection\_search.py in fit(self, X, y, groups, **fit_params)
644 verbose=self.verbose)
645 results = {}
--> 646 with parallel:
647 all_candidate_params = []
648 all_out = []
C:\anaconda\lib\site-packages\joblib\parallel.py in __enter__(self)
709 def __enter__(self):
710 self._managed_backend = True
--> 711 self._initialize_backend()
712 return self
713
C:\anaconda\lib\site-packages\joblib\parallel.py in _initialize_backend(self)
720 try:
721 n_jobs = self._backend.configure(n_jobs=self.n_jobs, parallel=self,
--> 722 **self._backend_args)
723 if self.timeout is not None and not self._backend.supports_timeout:
724 warnings.warn(
C:\anaconda\lib\site-packages\joblib\_parallel_backends.py in configure(self, n_jobs, parallel, prefer, require, idle_worker_timeout, **memmappingexecutor_args)
493 n_jobs, timeout=idle_worker_timeout,
494 env=self._prepare_worker_env(n_jobs=n_jobs),
--> 495 context_id=parallel._id, **memmappingexecutor_args)
496 self.parallel = parallel
497 return n_jobs
C:\anaconda\lib\site-packages\joblib\executor.py in get_memmapping_executor(n_jobs, **kwargs)
18
19 def get_memmapping_executor(n_jobs, **kwargs):
---> 20 return MemmappingExecutor.get_memmapping_executor(n_jobs, **kwargs)
21
22
C:\anaconda\lib\site-packages\joblib\executor.py in get_memmapping_executor(cls, n_jobs, timeout, initializer, initargs, env, temp_folder, context_id, **backend_args)
40 _executor_args = executor_args
41
---> 42 manager = TemporaryResourcesManager(temp_folder)
43
44 # reducers access the temporary folder in which to store temporary
C:\anaconda\lib\site-packages\joblib\_memmapping_reducer.py in __init__(self, temp_folder_root, context_id)
529 # exposes exposes too many low-level details.
530 context_id = uuid4().hex
--> 531 self.set_current_context(context_id)
532
533 def set_current_context(self, context_id):
C:\anaconda\lib\site-packages\joblib\_memmapping_reducer.py in set_current_context(self, context_id)
533 def set_current_context(self, context_id):
534 self._current_context_id = context_id
--> 535 self.register_new_context(context_id)
536
537 def register_new_context(self, context_id):
C:\anaconda\lib\site-packages\joblib\_memmapping_reducer.py in register_new_context(self, context_id)
558 new_folder_name, self._temp_folder_root
559 )
--> 560 self.register_folder_finalizer(new_folder_path, context_id)
561 self._cached_temp_folders[context_id] = new_folder_path
562
C:\anaconda\lib\site-packages\joblib\_memmapping_reducer.py in register_folder_finalizer(self, pool_subfolder, context_id)
588 # semaphores and pipes
589 pool_module_name = whichmodule(delete_folder, 'delete_folder')
--> 590 resource_tracker.register(pool_subfolder, "folder")
591
592 def _cleanup():
C:\anaconda\lib\site-packages\joblib\externals\loky\backend\resource_tracker.py in register(self, name, rtype)
189 '''Register a named resource, and increment its refcount.'''
190 self.ensure_running()
--> 191 self._send('REGISTER', name, rtype)
192
193 def unregister(self, name, rtype):
C:\anaconda\lib\site-packages\joblib\externals\loky\backend\resource_tracker.py in _send(self, cmd, name, rtype)
202
203 def _send(self, cmd, name, rtype):
--> 204 msg = '{0}:{1}:{2}\n'.format(cmd, name, rtype).encode('ascii')
205 if len(name) > 512:
206 # posix guarantees that writes to a pipe of less than PIPE_BUF
UnicodeEncodeError: 'ascii' codec can't encode characters in position 18-20: ordinal not in range(128)``