summaryrefslogblamecommitdiff
path: root/site/docs/1.5.0/api/java/org/apache/spark/mllib/clustering/LDAModel.html
blob: 1819625556e9109c6bfcebdeddec866c556feb8f (plain) (tree)
1
2
3
4
5
6
7



                                                                                                      
                                                                                
                       
                                       


























































































































































































































































































































































































                                                                                                                                                                                                                                                                                                                           
<!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 10:26:31 PDT 2015 -->
<title>LDAModel</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="LDAModel";
    }
//-->
</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/LDA.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/LDAOptimizer.html" title="interface 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/LDAModel.html" target="_top">Frames</a></li>
<li><a href="LDAModel.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>Constr&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>Constr&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 LDAModel" class="title">Class LDAModel</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.spark.mllib.clustering.LDAModel</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/mllib/util/Saveable.html" title="interface in org.apache.spark.mllib.util">Saveable</a></dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../../org/apache/spark/mllib/clustering/DistributedLDAModel.html" title="class in org.apache.spark.mllib.clustering">DistributedLDAModel</a>, <a href="../../../../../org/apache/spark/mllib/clustering/LocalLDAModel.html" title="class in org.apache.spark.mllib.clustering">LocalLDAModel</a></dd>
</dl>
<hr>
<br>
<pre>public abstract class <span class="strong">LDAModel</span>
extends java.lang.Object
implements <a href="../../../../../org/apache/spark/mllib/util/Saveable.html" title="interface in org.apache.spark.mllib.util">Saveable</a></pre>
<div class="block">:: Experimental ::
 <p>
 Latent Dirichlet Allocation (LDA) model.
 <p>
 This abstraction permits for different underlying representations,
 including local and distributed data structures.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== 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>scala.Tuple2&lt;int[],double[]&gt;[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDAModel.html#describeTopics()">describeTopics</a></strong>()</code>
<div class="block">Return the topics described by weighted terms.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract scala.Tuple2&lt;int[],double[]&gt;[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDAModel.html#describeTopics(int)">describeTopics</a></strong>(int&nbsp;maxTermsPerTopic)</code>
<div class="block">Return the topics described by weighted terms.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract <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/LDAModel.html#docConcentration()">docConcentration</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>protected abstract double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDAModel.html#gammaShape()">gammaShape</a></strong>()</code>
<div class="block">Shape parameter for random initialization of variational parameter gamma.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDAModel.html#k()">k</a></strong>()</code>
<div class="block">Number of topics</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDAModel.html#topicConcentration()">topicConcentration</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="altColor">
<td class="colFirst"><code>abstract <a href="../../../../../org/apache/spark/mllib/linalg/Matrix.html" title="interface in org.apache.spark.mllib.linalg">Matrix</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDAModel.html#topicsMatrix()">topicsMatrix</a></strong>()</code>
<div class="block">Inferred topics, where each topic is represented by a distribution over terms.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/clustering/LDAModel.html#vocabSize()">vocabSize</a></strong>()</code>
<div class="block">Vocabulary size (number of terms or terms in the vocabulary)</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.mllib.util.Saveable">
<!--   -->
</a>
<h3>Methods inherited from interface&nbsp;org.apache.spark.mllib.util.<a href="../../../../../org/apache/spark/mllib/util/Saveable.html" title="interface in org.apache.spark.mllib.util">Saveable</a></h3>
<code><a href="../../../../../org/apache/spark/mllib/util/Saveable.html#formatVersion()">formatVersion</a>, <a href="../../../../../org/apache/spark/mllib/util/Saveable.html#save(org.apache.spark.SparkContext, java.lang.String)">save</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="k()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>k</h4>
<pre>public abstract&nbsp;int&nbsp;k()</pre>
<div class="block">Number of topics</div>
</li>
</ul>
<a name="vocabSize()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>vocabSize</h4>
<pre>public abstract&nbsp;int&nbsp;vocabSize()</pre>
<div class="block">Vocabulary size (number of terms or terms in the vocabulary)</div>
</li>
</ul>
<a name="docConcentration()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>docConcentration</h4>
<pre>public abstract&nbsp;<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.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="topicConcentration()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>topicConcentration</h4>
<pre>public abstract&nbsp;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.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="gammaShape()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>gammaShape</h4>
<pre>protected abstract&nbsp;double&nbsp;gammaShape()</pre>
<div class="block">Shape parameter for random initialization of variational parameter gamma.
 Used for variational inference for perplexity and other test-time computations.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="topicsMatrix()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>topicsMatrix</h4>
<pre>public abstract&nbsp;<a href="../../../../../org/apache/spark/mllib/linalg/Matrix.html" title="interface in org.apache.spark.mllib.linalg">Matrix</a>&nbsp;topicsMatrix()</pre>
<div class="block">Inferred topics, where each topic is represented by a distribution over terms.
 This is a matrix of size vocabSize x k, where each column is a topic.
 No guarantees are given about the ordering of the topics.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="describeTopics(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>describeTopics</h4>
<pre>public abstract&nbsp;scala.Tuple2&lt;int[],double[]&gt;[]&nbsp;describeTopics(int&nbsp;maxTermsPerTopic)</pre>
<div class="block">Return the topics described by weighted terms.
 <p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>maxTermsPerTopic</code> - Maximum number of terms to collect for each topic.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Array over topics.  Each topic is represented as a pair of matching arrays:
          (term indices, term weights in topic).
          Each topic's terms are sorted in order of decreasing weight.</dd></dl>
</li>
</ul>
<a name="describeTopics()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>describeTopics</h4>
<pre>public&nbsp;scala.Tuple2&lt;int[],double[]&gt;[]&nbsp;describeTopics()</pre>
<div class="block">Return the topics described by weighted terms.
 <p>
 WARNING: If vocabSize and k are large, this can return a large object!
 <p></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Array over topics.  Each topic is represented as a pair of matching arrays:
          (term indices, term weights in topic).
          Each topic's terms are sorted in order of decreasing weight.</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/LDA.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/LDAOptimizer.html" title="interface 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/LDAModel.html" target="_top">Frames</a></li>
<li><a href="LDAModel.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>Constr&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>Constr&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>