summaryrefslogtreecommitdiff
path: root/site/docs/1.5.0/api/java/org/apache/spark/mllib/clustering/LDA.html
blob: 9330d9bca26f1383a57b5d58b199b3a2c756b404 (plain) (blame)
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
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_51) on Wed Sep 16 15:55:09 PDT 2015 -->
<title>LDA</title>
<meta name="date" content="2015-09-16">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="LDA";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/spark/mllib/clustering/KMeansModel.html" title="class in org.apache.spark.mllib.clustering"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/spark/mllib/clustering/LDAModel.html" title="class in org.apache.spark.mllib.clustering"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/spark/mllib/clustering/LDA.html" target="_top">Frames</a></li>
<li><a href="LDA.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.spark.mllib.clustering</div>
<h2 title="Class LDA" class="title">Class LDA</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.spark.mllib.clustering.LDA</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../../org/apache/spark/Logging.html" title="interface in org.apache.spark">Logging</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">LDA</span>
extends java.lang.Object
implements <a href="../../../../../org/apache/spark/Logging.html" title="interface in org.apache.spark">Logging</a></pre>
<div class="block">:: Experimental ::
 <p>
 Latent Dirichlet Allocation (LDA), a topic model designed for text documents.
 <p>
 Terminology:
  - "word" = "term": an element of the vocabulary
  - "token": instance of a term appearing in a document
  - "topic": multinomial distribution over words representing some concept
 <p>
 References:
  - Original LDA paper (journal version):
    Blei, Ng, and Jordan.  "Latent Dirichlet Allocation."  JMLR, 2003.
 <p></div>
<dl><dt><span class="strong">See Also:</span></dt><dd><code>http://en.wikipedia.org/wiki/Latent_Dirichlet_allocation Latent Dirichlet allocation
       (Wikipedia)}</code></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#LDA()">LDA</a></strong>()</code>
<div class="block">Constructs a LDA instance with default parameters.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#getAlpha()">getAlpha</a></strong>()</code>
<div class="block">Alias for <code>getDocConcentration</code></div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#getAsymmetricAlpha()">getAsymmetricAlpha</a></strong>()</code>
<div class="block">Alias for <code>getAsymmetricDocConcentration</code></div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#getAsymmetricDocConcentration()">getAsymmetricDocConcentration</a></strong>()</code>
<div class="block">Concentration parameter (commonly named "alpha") for the prior placed on documents'
 distributions over topics ("theta").</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#getBeta()">getBeta</a></strong>()</code>
<div class="block">Alias for <code>getTopicConcentration</code></div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#getCheckpointInterval()">getCheckpointInterval</a></strong>()</code>
<div class="block">Period (in iterations) between checkpoints.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#getDocConcentration()">getDocConcentration</a></strong>()</code>
<div class="block">Concentration parameter (commonly named "alpha") for the prior placed on documents'
 distributions over topics ("theta").</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#getK()">getK</a></strong>()</code>
<div class="block">Number of topics to infer.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#getMaxIterations()">getMaxIterations</a></strong>()</code>
<div class="block">Maximum number of iterations for learning.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/mllib/clustering/LDAOptimizer.html" title="interface in org.apache.spark.mllib.clustering">LDAOptimizer</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#getOptimizer()">getOptimizer</a></strong>()</code>
<div class="block">:: DeveloperApi ::</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#getSeed()">getSeed</a></strong>()</code>
<div class="block">Random seed</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#getTopicConcentration()">getTopicConcentration</a></strong>()</code>
<div class="block">Concentration parameter (commonly named "beta" or "eta") for the prior placed on topics'
 distributions over terms.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/mllib/clustering/LDAModel.html" title="class in org.apache.spark.mllib.clustering">LDAModel</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#run(org.apache.spark.api.java.JavaPairRDD)">run</a></strong>(<a href="../../../../../org/apache/spark/api/java/JavaPairRDD.html" title="class in org.apache.spark.api.java">JavaPairRDD</a>&lt;java.lang.Long,<a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a>&gt;&nbsp;documents)</code>
<div class="block">Java-friendly version of <code>run()</code></div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/mllib/clustering/LDAModel.html" title="class in org.apache.spark.mllib.clustering">LDAModel</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#run(org.apache.spark.rdd.RDD)">run</a></strong>(<a href="../../../../../org/apache/spark/rdd/RDD.html" title="class in org.apache.spark.rdd">RDD</a>&lt;scala.Tuple2&lt;java.lang.Object,<a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a>&gt;&gt;&nbsp;documents)</code>
<div class="block">Learn an LDA model using the given dataset.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#setAlpha(double)">setAlpha</a></strong>(double&nbsp;alpha)</code>
<div class="block">Alias for <code>setDocConcentration()</code></div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#setAlpha(org.apache.spark.mllib.linalg.Vector)">setAlpha</a></strong>(<a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a>&nbsp;alpha)</code>
<div class="block">Alias for <code>setDocConcentration()</code></div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#setBeta(double)">setBeta</a></strong>(double&nbsp;beta)</code>
<div class="block">Alias for <code>setTopicConcentration()</code></div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#setCheckpointInterval(int)">setCheckpointInterval</a></strong>(int&nbsp;checkpointInterval)</code>
<div class="block">Period (in iterations) between checkpoints (default = 10).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#setDocConcentration(double)">setDocConcentration</a></strong>(double&nbsp;docConcentration)</code>
<div class="block">Replicates a <code>Double</code> docConcentration to create a symmetric prior.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#setDocConcentration(org.apache.spark.mllib.linalg.Vector)">setDocConcentration</a></strong>(<a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a>&nbsp;docConcentration)</code>
<div class="block">Concentration parameter (commonly named "alpha") for the prior placed on documents'
 distributions over topics ("theta").</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#setK(int)">setK</a></strong>(int&nbsp;k)</code>
<div class="block">Number of topics to infer.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#setMaxIterations(int)">setMaxIterations</a></strong>(int&nbsp;maxIterations)</code>
<div class="block">Maximum number of iterations for learning.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#setOptimizer(org.apache.spark.mllib.clustering.LDAOptimizer)">setOptimizer</a></strong>(<a href="../../../../../org/apache/spark/mllib/clustering/LDAOptimizer.html" title="interface in org.apache.spark.mllib.clustering">LDAOptimizer</a>&nbsp;optimizer)</code>
<div class="block">:: DeveloperApi ::</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#setOptimizer(java.lang.String)">setOptimizer</a></strong>(java.lang.String&nbsp;optimizerName)</code>
<div class="block">Set the LDAOptimizer used to perform the actual calculation by algorithm name.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#setSeed(long)">setSeed</a></strong>(long&nbsp;seed)</code>
<div class="block">Random seed</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDA.html#setTopicConcentration(double)">setTopicConcentration</a></strong>(double&nbsp;topicConcentration)</code>
<div class="block">Concentration parameter (commonly named "beta" or "eta") for the prior placed on topics'
 distributions over terms.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.apache.spark.Logging">
<!--   -->
</a>
<h3>Methods inherited from interface&nbsp;org.apache.spark.<a href="../../../../../org/apache/spark/Logging.html" title="interface in org.apache.spark">Logging</a></h3>
<code><a href="../../../../../org/apache/spark/Logging.html#initializeIfNecessary()">initializeIfNecessary</a>, <a href="../../../../../org/apache/spark/Logging.html#initializeLogging()">initializeLogging</a>, <a href="../../../../../org/apache/spark/Logging.html#isTraceEnabled()">isTraceEnabled</a>, <a href="../../../../../org/apache/spark/Logging.html#log_()">log_</a>, <a href="../../../../../org/apache/spark/Logging.html#log()">log</a>, <a href="../../../../../org/apache/spark/Logging.html#logDebug(scala.Function0)">logDebug</a>, <a href="../../../../../org/apache/spark/Logging.html#logDebug(scala.Function0, java.lang.Throwable)">logDebug</a>, <a href="../../../../../org/apache/spark/Logging.html#logError(scala.Function0)">logError</a>, <a href="../../../../../org/apache/spark/Logging.html#logError(scala.Function0, java.lang.Throwable)">logError</a>, <a href="../../../../../org/apache/spark/Logging.html#logInfo(scala.Function0)">logInfo</a>, <a href="../../../../../org/apache/spark/Logging.html#logInfo(scala.Function0, java.lang.Throwable)">logInfo</a>, <a href="../../../../../org/apache/spark/Logging.html#logName()">logName</a>, <a href="../../../../../org/apache/spark/Logging.html#logTrace(scala.Function0)">logTrace</a>, <a href="../../../../../org/apache/spark/Logging.html#logTrace(scala.Function0, java.lang.Throwable)">logTrace</a>, <a href="../../../../../org/apache/spark/Logging.html#logWarning(scala.Function0)">logWarning</a>, <a href="../../../../../org/apache/spark/Logging.html#logWarning(scala.Function0, java.lang.Throwable)">logWarning</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="LDA()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>LDA</h4>
<pre>public&nbsp;LDA()</pre>
<div class="block">Constructs a LDA instance with default parameters.</div>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="getK()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getK</h4>
<pre>public&nbsp;int&nbsp;getK()</pre>
<div class="block">Number of topics to infer.  I.e., the number of soft cluster centers.
 <p></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="setK(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setK</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a>&nbsp;setK(int&nbsp;k)</pre>
<div class="block">Number of topics to infer.  I.e., the number of soft cluster centers.
 (default = 10)</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>k</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="getAsymmetricDocConcentration()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAsymmetricDocConcentration</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a>&nbsp;getAsymmetricDocConcentration()</pre>
<div class="block">Concentration parameter (commonly named "alpha") for the prior placed on documents'
 distributions over topics ("theta").
 <p>
 This is the parameter to a Dirichlet distribution.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="getDocConcentration()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDocConcentration</h4>
<pre>public&nbsp;double&nbsp;getDocConcentration()</pre>
<div class="block">Concentration parameter (commonly named "alpha") for the prior placed on documents'
 distributions over topics ("theta").
 <p>
 This method assumes the Dirichlet distribution is symmetric and can be described by a single
 <code>Double</code> parameter. It should fail if docConcentration is asymmetric.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="setDocConcentration(org.apache.spark.mllib.linalg.Vector)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setDocConcentration</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a>&nbsp;setDocConcentration(<a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a>&nbsp;docConcentration)</pre>
<div class="block">Concentration parameter (commonly named "alpha") for the prior placed on documents'
 distributions over topics ("theta").
 <p>
 This is the parameter to a Dirichlet distribution, where larger values mean more smoothing
 (more regularization).
 <p>
 If set to a singleton vector Vector(-1), then docConcentration is set automatically. If set to
 singleton vector Vector(t) where t != -1, then t is replicated to a vector of length k during
 <code>LDAOptimizer.initialize()</code>. Otherwise, the <code>docConcentration</code> vector must be length k.
 (default = Vector(-1) = automatic)
 <p>
 Optimizer-specific parameter settings:
  - EM
     - Currently only supports symmetric distributions, so all values in the vector should be
       the same.
     - Values should be > 1.0
     - default = uniformly (50 / k) + 1, where 50/k is common in LDA libraries and +1 follows
       from Asuncion et al. (2009), who recommend a +1 adjustment for EM.
  - Online
     - Values should be >= 0
     - default = uniformly (1.0 / k), following the implementation from
       <code>https://github.com/Blei-Lab/onlineldavb</code>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>docConcentration</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="setDocConcentration(double)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setDocConcentration</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a>&nbsp;setDocConcentration(double&nbsp;docConcentration)</pre>
<div class="block">Replicates a <code>Double</code> docConcentration to create a symmetric prior.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>docConcentration</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="getAsymmetricAlpha()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAsymmetricAlpha</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a>&nbsp;getAsymmetricAlpha()</pre>
<div class="block">Alias for <code>getAsymmetricDocConcentration</code></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="getAlpha()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAlpha</h4>
<pre>public&nbsp;double&nbsp;getAlpha()</pre>
<div class="block">Alias for <code>getDocConcentration</code></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="setAlpha(org.apache.spark.mllib.linalg.Vector)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAlpha</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a>&nbsp;setAlpha(<a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a>&nbsp;alpha)</pre>
<div class="block">Alias for <code>setDocConcentration()</code></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>alpha</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="setAlpha(double)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAlpha</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a>&nbsp;setAlpha(double&nbsp;alpha)</pre>
<div class="block">Alias for <code>setDocConcentration()</code></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>alpha</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="getTopicConcentration()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTopicConcentration</h4>
<pre>public&nbsp;double&nbsp;getTopicConcentration()</pre>
<div class="block">Concentration parameter (commonly named "beta" or "eta") for the prior placed on topics'
 distributions over terms.
 <p>
 This is the parameter to a symmetric Dirichlet distribution.
 <p>
 Note: The topics' distributions over terms are called "beta" in the original LDA paper
 by Blei et al., but are called "phi" in many later papers such as Asuncion et al., 2009.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="setTopicConcentration(double)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setTopicConcentration</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a>&nbsp;setTopicConcentration(double&nbsp;topicConcentration)</pre>
<div class="block">Concentration parameter (commonly named "beta" or "eta") for the prior placed on topics'
 distributions over terms.
 <p>
 This is the parameter to a symmetric Dirichlet distribution.
 <p>
 Note: The topics' distributions over terms are called "beta" in the original LDA paper
 by Blei et al., but are called "phi" in many later papers such as Asuncion et al., 2009.
 <p>
 If set to -1, then topicConcentration is set automatically.
  (default = -1 = automatic)
 <p>
 Optimizer-specific parameter settings:
  - EM
     - Value should be > 1.0
     - default = 0.1 + 1, where 0.1 gives a small amount of smoothing and +1 follows
       Asuncion et al. (2009), who recommend a +1 adjustment for EM.
  - Online
     - Value should be >= 0
     - default = (1.0 / k), following the implementation from
       <code>https://github.com/Blei-Lab/onlineldavb</code>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>topicConcentration</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="getBeta()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBeta</h4>
<pre>public&nbsp;double&nbsp;getBeta()</pre>
<div class="block">Alias for <code>getTopicConcentration</code></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="setBeta(double)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setBeta</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a>&nbsp;setBeta(double&nbsp;beta)</pre>
<div class="block">Alias for <code>setTopicConcentration()</code></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>beta</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="getMaxIterations()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxIterations</h4>
<pre>public&nbsp;int&nbsp;getMaxIterations()</pre>
<div class="block">Maximum number of iterations for learning.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="setMaxIterations(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMaxIterations</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a>&nbsp;setMaxIterations(int&nbsp;maxIterations)</pre>
<div class="block">Maximum number of iterations for learning.
 (default = 20)</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>maxIterations</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="getSeed()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSeed</h4>
<pre>public&nbsp;long&nbsp;getSeed()</pre>
<div class="block">Random seed</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="setSeed(long)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSeed</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a>&nbsp;setSeed(long&nbsp;seed)</pre>
<div class="block">Random seed</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>seed</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="getCheckpointInterval()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCheckpointInterval</h4>
<pre>public&nbsp;int&nbsp;getCheckpointInterval()</pre>
<div class="block">Period (in iterations) between checkpoints.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="setCheckpointInterval(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setCheckpointInterval</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a>&nbsp;setCheckpointInterval(int&nbsp;checkpointInterval)</pre>
<div class="block">Period (in iterations) between checkpoints (default = 10). Checkpointing helps with recovery
 (when nodes fail). It also helps with eliminating temporary shuffle files on disk, which can be
 important when LDA is run for many iterations. If the checkpoint directory is not set in
 <a href="../../../../../org/apache/spark/SparkContext.html" title="class in org.apache.spark"><code>SparkContext</code></a>, this setting is ignored.
 <p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>checkpointInterval</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/spark/SparkContext.html#setCheckpointDir(java.lang.String)"><code>SparkContext.setCheckpointDir(java.lang.String)</code></a></dd></dl>
</li>
</ul>
<a name="getOptimizer()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getOptimizer</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/mllib/clustering/LDAOptimizer.html" title="interface in org.apache.spark.mllib.clustering">LDAOptimizer</a>&nbsp;getOptimizer()</pre>
<div class="block">:: DeveloperApi ::
 <p>
 LDAOptimizer used to perform the actual calculation</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="setOptimizer(org.apache.spark.mllib.clustering.LDAOptimizer)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setOptimizer</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a>&nbsp;setOptimizer(<a href="../../../../../org/apache/spark/mllib/clustering/LDAOptimizer.html" title="interface in org.apache.spark.mllib.clustering">LDAOptimizer</a>&nbsp;optimizer)</pre>
<div class="block">:: DeveloperApi ::
 <p>
 LDAOptimizer used to perform the actual calculation (default = EMLDAOptimizer)</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>optimizer</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="setOptimizer(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setOptimizer</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/mllib/clustering/LDA.html" title="class in org.apache.spark.mllib.clustering">LDA</a>&nbsp;setOptimizer(java.lang.String&nbsp;optimizerName)</pre>
<div class="block">Set the LDAOptimizer used to perform the actual calculation by algorithm name.
 Currently "em", "online" are supported.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>optimizerName</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="run(org.apache.spark.rdd.RDD)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>run</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/mllib/clustering/LDAModel.html" title="class in org.apache.spark.mllib.clustering">LDAModel</a>&nbsp;run(<a href="../../../../../org/apache/spark/rdd/RDD.html" title="class in org.apache.spark.rdd">RDD</a>&lt;scala.Tuple2&lt;java.lang.Object,<a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a>&gt;&gt;&nbsp;documents)</pre>
<div class="block">Learn an LDA model using the given dataset.
 <p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>documents</code> - RDD of documents, which are term (word) count vectors paired with IDs.
                   The term count vectors are "bags of words" with a fixed-size vocabulary
                   (where the vocabulary size is the length of the vector).
                   Document IDs must be unique and >= 0.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Inferred LDA model</dd></dl>
</li>
</ul>
<a name="run(org.apache.spark.api.java.JavaPairRDD)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>run</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/spark/mllib/clustering/LDAModel.html" title="class in org.apache.spark.mllib.clustering">LDAModel</a>&nbsp;run(<a href="../../../../../org/apache/spark/api/java/JavaPairRDD.html" title="class in org.apache.spark.api.java">JavaPairRDD</a>&lt;java.lang.Long,<a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a>&gt;&nbsp;documents)</pre>
<div class="block">Java-friendly version of <code>run()</code></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>documents</code> - (undocumented)</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/spark/mllib/clustering/KMeansModel.html" title="class in org.apache.spark.mllib.clustering"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/spark/mllib/clustering/LDAModel.html" title="class in org.apache.spark.mllib.clustering"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/spark/mllib/clustering/LDA.html" target="_top">Frames</a></li>
<li><a href="LDA.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<script defer="defer" type="text/javascript" src="../../../../../lib/jquery.js"></script><script defer="defer" type="text/javascript" src="../../../../../lib/api-javadocs.js"></script></body>
</html>