質問編集履歴
1
不要な部分を削除しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,13 +1,3 @@
|
|
1
|
-
https://www.ogis-ri.co.jp/otc/hiroba/technical/similar-document-search/part6.html
|
2
|
-
|
3
|
-
のページの下4分の3くらいにある、LDAの実装で、lda.fitを行うと下記のエラーが出ます。
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
utf-8で書いています。
|
8
|
-
|
9
|
-
|
10
|
-
|
11
1
|
---------------------------
|
12
2
|
|
13
3
|
UnicodeEncodeError Traceback (most recent call last)
|
@@ -19,175 +9,3 @@
|
|
19
9
|
3 lda = LDA(n_components=5, max_iter=30, n_jobs=-1, verbose=1, evaluate_every=1)
|
20
10
|
|
21
11
|
----> 4 lda.fit(X_tfidf)
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
C:\Users\Public\anaconda3\envs\py37\lib\site-packages\sklearn\decomposition\_lda.py in fit(self, X, y)
|
26
|
-
|
27
|
-
556 last_bound = None
|
28
|
-
|
29
|
-
557 n_jobs = effective_n_jobs(self.n_jobs)
|
30
|
-
|
31
|
-
--> 558 with Parallel(n_jobs=n_jobs,
|
32
|
-
|
33
|
-
559 verbose=max(0, self.verbose - 1)) as parallel:
|
34
|
-
|
35
|
-
560 for i in range(max_iter):
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
C:\Users\Public\anaconda3\envs\py37\lib\site-packages\joblib\parallel.py in __enter__(self)
|
40
|
-
|
41
|
-
709 def __enter__(self):
|
42
|
-
|
43
|
-
710 self._managed_backend = True
|
44
|
-
|
45
|
-
--> 711 self._initialize_backend()
|
46
|
-
|
47
|
-
712 return self
|
48
|
-
|
49
|
-
713
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
C:\Users\Public\anaconda3\envs\py37\lib\site-packages\joblib\parallel.py in _initialize_backend(self)
|
54
|
-
|
55
|
-
719 """Build a process or thread pool and return the number of workers"""
|
56
|
-
|
57
|
-
720 try:
|
58
|
-
|
59
|
-
--> 721 n_jobs = self._backend.configure(n_jobs=self.n_jobs, parallel=self,
|
60
|
-
|
61
|
-
722 **self._backend_args)
|
62
|
-
|
63
|
-
723 if self.timeout is not None and not self._backend.supports_timeout:
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
C:\Users\Public\anaconda3\envs\py37\lib\site-packages\joblib\_parallel_backends.py in configure(self, n_jobs, parallel, prefer, require, idle_worker_timeout, **memmappingexecutor_args)
|
68
|
-
|
69
|
-
490 SequentialBackend(nesting_level=self.nesting_level))
|
70
|
-
|
71
|
-
491
|
72
|
-
|
73
|
-
--> 492 self._workers = get_memmapping_executor(
|
74
|
-
|
75
|
-
493 n_jobs, timeout=idle_worker_timeout,
|
76
|
-
|
77
|
-
494 env=self._prepare_worker_env(n_jobs=n_jobs),
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
C:\Users\Public\anaconda3\envs\py37\lib\site-packages\joblib\executor.py in get_memmapping_executor(n_jobs, **kwargs)
|
82
|
-
|
83
|
-
18
|
84
|
-
|
85
|
-
19 def get_memmapping_executor(n_jobs, **kwargs):
|
86
|
-
|
87
|
-
---> 20 return MemmappingExecutor.get_memmapping_executor(n_jobs, **kwargs)
|
88
|
-
|
89
|
-
21
|
90
|
-
|
91
|
-
22
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
C:\Users\Public\anaconda3\envs\py37\lib\site-packages\joblib\executor.py in get_memmapping_executor(cls, n_jobs, timeout, initializer, initargs, env, temp_folder, context_id, **backend_args)
|
96
|
-
|
97
|
-
40 _executor_args = executor_args
|
98
|
-
|
99
|
-
41
|
100
|
-
|
101
|
-
---> 42 manager = TemporaryResourcesManager(temp_folder)
|
102
|
-
|
103
|
-
43
|
104
|
-
|
105
|
-
44 # reducers access the temporary folder in which to store temporary
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
C:\Users\Public\anaconda3\envs\py37\lib\site-packages\joblib\_memmapping_reducer.py in __init__(self, temp_folder_root, context_id)
|
110
|
-
|
111
|
-
529 # exposes exposes too many low-level details.
|
112
|
-
|
113
|
-
530 context_id = uuid4().hex
|
114
|
-
|
115
|
-
--> 531 self.set_current_context(context_id)
|
116
|
-
|
117
|
-
532
|
118
|
-
|
119
|
-
533 def set_current_context(self, context_id):
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
C:\Users\Public\anaconda3\envs\py37\lib\site-packages\joblib\_memmapping_reducer.py in set_current_context(self, context_id)
|
124
|
-
|
125
|
-
533 def set_current_context(self, context_id):
|
126
|
-
|
127
|
-
534 self._current_context_id = context_id
|
128
|
-
|
129
|
-
--> 535 self.register_new_context(context_id)
|
130
|
-
|
131
|
-
536
|
132
|
-
|
133
|
-
537 def register_new_context(self, context_id):
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
C:\Users\Public\anaconda3\envs\py37\lib\site-packages\joblib\_memmapping_reducer.py in register_new_context(self, context_id)
|
138
|
-
|
139
|
-
558 new_folder_name, self._temp_folder_root
|
140
|
-
|
141
|
-
559 )
|
142
|
-
|
143
|
-
--> 560 self.register_folder_finalizer(new_folder_path, context_id)
|
144
|
-
|
145
|
-
561 self._cached_temp_folders[context_id] = new_folder_path
|
146
|
-
|
147
|
-
562
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
C:\Users\Public\anaconda3\envs\py37\lib\site-packages\joblib\_memmapping_reducer.py in register_folder_finalizer(self, pool_subfolder, context_id)
|
152
|
-
|
153
|
-
588 # semaphores and pipes
|
154
|
-
|
155
|
-
589 pool_module_name = whichmodule(delete_folder, 'delete_folder')
|
156
|
-
|
157
|
-
--> 590 resource_tracker.register(pool_subfolder, "folder")
|
158
|
-
|
159
|
-
591
|
160
|
-
|
161
|
-
592 def _cleanup():
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
C:\Users\Public\anaconda3\envs\py37\lib\site-packages\joblib\externals\loky\backend\resource_tracker.py in register(self, name, rtype)
|
166
|
-
|
167
|
-
189 '''Register a named resource, and increment its refcount.'''
|
168
|
-
|
169
|
-
190 self.ensure_running()
|
170
|
-
|
171
|
-
--> 191 self._send('REGISTER', name, rtype)
|
172
|
-
|
173
|
-
192
|
174
|
-
|
175
|
-
193 def unregister(self, name, rtype):
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
C:\Users\Public\anaconda3\envs\py37\lib\site-packages\joblib\externals\loky\backend\resource_tracker.py in _send(self, cmd, name, rtype)
|
180
|
-
|
181
|
-
202
|
182
|
-
|
183
|
-
203 def _send(self, cmd, name, rtype):
|
184
|
-
|
185
|
-
--> 204 msg = '{0}:{1}:{2}\n'.format(cmd, name, rtype).encode('ascii')
|
186
|
-
|
187
|
-
205 if len(name) > 512:
|
188
|
-
|
189
|
-
206 # posix guarantees that writes to a pipe of less than PIPE_BUF
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
UnicodeEncodeError: 'ascii' codec can't encode characters in position 18-19: ordinal not in range(128)
|