-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSIOME.out
executable file
·363 lines (346 loc) · 10.6 KB
/
SIOME.out
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
>>> from pylda import pylda
>>> docs = pylda.parse_lda_data("/home/top/programas/lda-c-dist/boston-la")
>>> phi,theta = pylda.run(10,1.,1.,docs, 30)
-1203287.28819
-1160890.36032
-1138849.22936
-1048056.54439
-661165.493644
-336098.871519
-283392.697918
-282223.407727
-282266.336612
C-c C-cTraceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/top/.local/lib/python2.6/site-packages/pylda/pylda.py", line 134, in run
pa,pb,Ntopics,Nwords,Ndocuments,alpha, beta)
File "/home/top/.local/lib/python2.6/site-packages/pylda/pylda.py", line 70, in cond_dist
nt = categorical2(pt)
File "/home/top/.local/lib/python2.6/site-packages/pylda/pylda.py", line 54, in categorical2
return np.argmax(np.random.multinomial(1,probs))
KeyboardInterrupt
>>> phi,theta = pylda.run(10,1.,1.,docs, 9)
-1203419.3923
-1160636.29964
-1134387.06618
-1047611.44666
-831200.257919
-525929.575476
-302778.600811
-282401.857468
-282229.900407
returning phi, theta
>>> pylda.print_topics(phi)
topico 0 :
OxOOOxxxOxxxxxxxxxxxxxxxx
xxxOxxxxxxxxxxxxxxxxxxxxx
REALLY
OxxOOOxxOOOxxOOxxxxxxxxxx
xOOxOxOxxxxxxxxxxxxxxxxxx
OOOOOOOOxOxxxxxxxxxxxxxxx
OOOOOOOOOOOOOxOxxxxxxxxxx
OOOOOOOOOxxxOxxxxxxxxxxxx
xOOOOxxOxOxxxxOxxxxxxxxxx
OOOOOOxOOxOxxxxxxxxxxxxxx
xxOOxxxxOxxxxxxxxxxxxxxxx
xxxOxxxxOxxxxOxxxxxxxxxxx
NORTHRIDGE
OOOxOOOOxOOxOxOxxxxxxxxxx
OOOOOOxOOOOxOOxxxxxxxxxxx
OOOOOOOOxOOxxxxxxxxxxxxxx
OOOOOOOOOxOxxxxxxxxxxxxxx
OxOOOxxOOOxxOOxxxxxxxxxxx
OOOOOOxOOOxxOOxxxxxxxxxxx
xxOxOxxOxOxxOxOxxxxxxxxxx
topico 1 :
xOOOOxOOOOxOOOOxxxxxxxxxx
OxxxOxxxxOxxxxxxxxxxxxxxx
OOOOOOOOOOxOxxxxxxxxxxxxx
OOOxOOOOxxOOxxxxxxxxxxxxx
OOOxOOOOxOOOOxxxxxxxxxxxx
xOOxOxOOxOxOOxOxxxxxxxxxx
OOOOOxOOOOxxOxxxxxxxxxxxx
SUPPOSE
OOOxOOOOxxxOOxxxxxxxxxxxx
OOOOOOOOxxOxxxxxxxxxxxxxx
OxO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xOxxxxxxxxxxx
ONONE
OOOOOxOOOOxxOOOxxxxxxxxxx
xOOOOxxOOOxxOxOxxxxxxxxxx
OOOOxxxOxxxxxxxxxxxxxxxxx
xxxOOxxxOOxxxxOxxxxxxxxxx
OOOxOxOOxOxxxxxxxxxxxxxxx
OOxOxOxxOxxxxOxxxxxxxxxxx
OOxxOOOxxOxxxxOxxxxxxxxxx
xOxOOxxxxOxxxxOxxxxxxxxxx
>>> reload(pylda)
<module 'pylda.pylda' from '/home/top/.local/lib/python2.6/site-packages/pylda/pylda.py'>
>>> docs = pylda.parse_lda_data("/home/top/programas/lda-c-dist/boston-la")
>>> pylda.reverse_map["headshake:slow"]
692
>>> dhs = [d for d in docs if d[692]]
>>> len(dhs)
7
>>> import random
>>> nondhs = random.sample(docs,7)
>>> nondhs
>>> len(nondhs)
7
>>> cats = [1 for i in xrange(7)] + [0 for i in xrange(7)]
>>> obs = dhs + nondhs
>>> import svm
>>> params = svm.svm_parameter(C=1, kernel_type=svm.LINEAR)
>>> problem = svm.svm_problem(cats,obs)
>>> target = svm.cross_validaion(problem,params,14)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'cross_validaion'
>>> target = svm.cross_validation(problem,params,14)
>>> rr = sum(target[i] == cats[i])/14.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'bool' object is not iterable
>>> rr = sum(target[i] == cats[i] for i in xrange(14))/14.
>>> rr
0.6428571428571429
>>> dhs = [d for d in docs if d[pylda.reverse_map["MORE"]]]
>>> len(dhs0
... C-c C-c
KeyboardInterrupt
>>> len(dhs)
492
>>> nondhs = random.sample([d for d in docs if not d[pylda.reverse_map["MORE"]]],500)
>>> cats = [1 for i in dhs] + [0 for i in nondhs]
>>> obs = dhs + nondhs
>>> zobs = zip(obs,cats)
>>> random.shuffle(zobs)
>>> obs,cats = zip(*zobs)
>>> len(obs)
992
>>> problem = svm.svm_problem(cats,obs)
1
>>> >>> 1
>>> target = svm.cross_validation(problem,params,20)
1
>>> >>> 1
>>> rr = sum(target[i] == cats[i] for i in cats)/float(len(cats))
>>> rr
1.0
>>> reload(lda)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'lda' is not defined
>>> reload(pylda)
<module 'pylda.pylda' from '/home/top/.local/lib/python2.6/site-packages/pylda/pylda.pyc'>
>>> docs = pylda.parse_lda_data("/home/top/programas/lda-c-dist/boston-la")
>>> pylda.test("WHERE")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'test'
>>> reload(pylda)
<module 'pylda.pylda' from '/home/top/.local/lib/python2.6/site-packages/pylda/pylda.py'>
>>> docs = pylda.parse_lda_data("/home/top/programas/lda-c-dist/boston-la")
>>> pylda.test("WHERE", docs)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/top/.local/lib/python2.6/site-packages/pylda/pylda.py", line 177, in test
nondocs = random.sample([d for d in docs if not d[reverse_map[word]]],len(docs))
File "/usr/lib/python2.6/random.py", line 316, in sample
raise ValueError, "sample larger than population"
ValueError: sample larger than population
>>> reload(pylda)
<module 'pylda.pylda' from '/home/top/.local/lib/python2.6/site-packages/pylda/pylda.py'>
>>> docs = pylda.parse_lda_data("/home/top/programas/lda-c-dist/boston-la")
>>> reload(pylda)
<module 'pylda.pylda' from '/home/top/.local/lib/python2.6/site-packages/pylda/pylda.py'>
>>> docs = pylda.parse_lda_data("/home/top/programas/lda-c-dist/boston-la")
>>> pylda.test("WHERE", docs)
171 0
1.0
>>> len(docs)
12922
>>> reload(pylda)
<module 'pylda.pylda' from '/home/top/.local/lib/python2.6/site-packages/pylda/pylda.py'>
>>> docs = pylda.parse_lda_data("/home/top/programas/lda-c-dist/boston-la")
>>> pylda.test("WHERE", docs)
>>> pylda.test("COMPARE", docs)
4 4
0.5
>>>
>>> pylda.test("SAME", docs)
59 59
1.0
>>> pylda.test("WHERE", docs)
171 171
1.0
>>> pylda.test("SUPPOSE", docs)
138 138
1.0