blob: 770480ea91acfc1532afc90f70344da63955fc0c [file] [log] [blame]
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<title>decompositions - Mahout Math Scala bindings 0.13.0 API - org.apache.mahout.math.decompositions</title>
<meta name="description" content="decompositions - Mahout Math Scala bindings 0.13.0 API - org.apache.mahout.math.decompositions" />
<meta name="keywords" content="decompositions Mahout Math Scala bindings 0.13.0 API org.apache.mahout.math.decompositions" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link href="../../../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
<link href="../../../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />
<script type="text/javascript">
if(top === self) {
var url = '../../../../../index.html';
var hash = 'org.apache.mahout.math.decompositions.package';
var anchor = window.location.hash;
var anchor_opt = '';
if (anchor.length >= 1)
anchor_opt = '@' + anchor.substring(1);
window.location.href = url + '#' + hash + anchor_opt;
}
</script>
</head>
<body class="value">
<div id="definition">
<img src="../../../../../lib/package_big.png" />
<p id="owner"><a href="../../../../package.html" class="extype" name="org">org</a>.<a href="../../../package.html" class="extype" name="org.apache">apache</a>.<a href="../../package.html" class="extype" name="org.apache.mahout">mahout</a>.<a href="../package.html" class="extype" name="org.apache.mahout.math">math</a></p>
<h1>decompositions</h1>
</div>
<h4 id="signature" class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<span class="name">decompositions</span>
</span>
</h4>
<div id="comment" class="fullcommenttop"><div class="comment cmt"><p>This package holds all decomposition and factorization-like methods, all that we were able to make
distributed engine-independent so far, anyway.
</p></div><div class="toggleContainer block">
<span class="toggle">Linear Supertypes</span>
<div class="superTypes hiddenContent"><span class="extype" name="scala.AnyRef">AnyRef</span>, <span class="extype" name="scala.Any">Any</span></div>
</div></div>
<div id="mbrsel">
<div id="textfilter"><span class="pre"></span><span class="input"><input id="mbrsel-input" type="text" accesskey="/" /></span><span class="post"></span></div>
<div id="order">
<span class="filtertype">Ordering</span>
<ol>
<li class="alpha in"><span>Alphabetic</span></li>
<li class="inherit out"><span>By inheritance</span></li>
</ol>
</div>
<div id="ancestors">
<span class="filtertype">Inherited<br />
</span>
<ol id="linearization">
<li class="in" name="org.apache.mahout.math.decompositions"><span>decompositions</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li>
</ol>
</div><div id="ancestors">
<span class="filtertype"></span>
<ol>
<li class="hideall out"><span>Hide All</span></li>
<li class="showall in"><span>Show all</span></li>
</ol>
<a href="http://docs.scala-lang.org/overviews/scaladoc/usage.html#members" target="_blank">Learn more about member selection</a>
</div>
<div id="visbl">
<span class="filtertype">Visibility</span>
<ol><li class="public in"><span>Public</span></li><li class="all out"><span>All</span></li></ol>
</div>
</div>
<div id="template">
<div id="allMembers">
<div id="types" class="types members">
<h3>Type Members</h3>
<ol><li name="org.apache.mahout.math.decompositions.FactorizationResult" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped">
<a id="FactorizationResult[K]=org.apache.mahout.math.decompositions.ALS.Result[K]"></a>
<a id="FactorizationResult[K]:FactorizationResult[K]"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">type</span>
</span>
<span class="symbol">
<span class="name">FactorizationResult</span><span class="tparams">[<span name="K">K</span>]</span><span class="result"> = <span class="extype" name="org.apache.mahout.math.decompositions.ALS.Result">Result</span>[<span class="extype" name="org.apache.mahout.math.decompositions.FactorizationResult.K">K</span>]</span>
</span>
</h4>
<p class="shortcomment cmt">Result for distributed ALS-type two-component factorization algorithms</p>
</li><li name="org.apache.mahout.math.decompositions.FactorizationResultInCore" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped">
<a id="FactorizationResultInCore=org.apache.mahout.math.decompositions.ALS.InCoreResult"></a>
<a id="FactorizationResultInCore:FactorizationResultInCore"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">type</span>
</span>
<span class="symbol">
<span class="name">FactorizationResultInCore</span><span class="result"> = <span class="extype" name="org.apache.mahout.math.decompositions.ALS.InCoreResult">InCoreResult</span></span>
</span>
</h4>
<p class="shortcomment cmt">Result for distributed ALS-type two-component factorization algorithms, in-core matrices</p>
</li></ol>
</div>
<div id="values" class="values members">
<h3>Value Members</h3>
<ol><li name="org.apache.mahout.math.decompositions.DQR" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped">
<a id="DQR"></a>
<a id="DQR:DQR"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">object</span>
</span>
<span class="symbol">
<a href="DQR$.html"><span class="name">DQR</span></a>
</span>
</h4>
</li><li name="org.apache.mahout.math.decompositions.DSPCA" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped">
<a id="DSPCA"></a>
<a id="DSPCA:DSPCA"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">object</span>
</span>
<span class="symbol">
<a href="DSPCA$.html"><span class="name">DSPCA</span></a>
</span>
</h4>
</li><li name="org.apache.mahout.math.decompositions.DSSVD" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped">
<a id="DSSVD"></a>
<a id="DSSVD:DSSVD"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">object</span>
</span>
<span class="symbol">
<a href="DSSVD$.html"><span class="name">DSSVD</span></a>
</span>
</h4>
</li><li name="org.apache.mahout.math.decompositions.package#dals" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="dals[K](drmA:org.apache.mahout.math.drm.DrmLike[K],k:Int,lambda:Double,maxIterations:Int,convergenceThreshold:Double)(implicitevidence$4:scala.reflect.ClassTag[K]):org.apache.mahout.math.decompositions.package.FactorizationResult[K]"></a>
<a id="dals[K](DrmLike[K],Int,Double,Int,Double)(ClassTag[K]):FactorizationResult[K]"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">dals</span><span class="tparams">[<span name="K">K</span>]</span><span class="params">(<span name="drmA">drmA: <a href="../drm/DrmLike.html" class="extype" name="org.apache.mahout.math.drm.DrmLike">DrmLike</a>[<span class="extype" name="org.apache.mahout.math.decompositions.dals.K">K</span>]</span>, <span name="k">k: <span class="extype" name="scala.Int">Int</span> = <span class="symbol">50</span></span>, <span name="lambda">lambda: <span class="extype" name="scala.Double">Double</span> = <span class="symbol">0.0</span></span>, <span name="maxIterations">maxIterations: <span class="extype" name="scala.Int">Int</span> = <span class="symbol">10</span></span>, <span name="convergenceThreshold">convergenceThreshold: <span class="extype" name="scala.Double">Double</span> = <span class="symbol">0.10</span></span>)</span><span class="params">(<span class="implicit">implicit </span><span name="arg0">arg0: <span class="extype" name="scala.reflect.ClassTag">ClassTag</span>[<span class="extype" name="org.apache.mahout.math.decompositions.dals.K">K</span>]</span>)</span><span class="result">: <a href="#FactorizationResult[K]=org.apache.mahout.math.decompositions.ALS.Result[K]" class="extmbr" name="org.apache.mahout.math.decompositions.FactorizationResult">FactorizationResult</a>[<span class="extype" name="org.apache.mahout.math.decompositions.dals.K">K</span>]</span>
</span>
</h4>
<p class="shortcomment cmt">Run ALS.</p><div class="fullcomment"><div class="comment cmt"><p>Run ALS.
&lt;P&gt;</p><p>Example:</p><p><pre>
val (u,v,errors) = als(input, k).toTuple
</pre></p><p>ALS runs until (rmse[i-1]-rmse[i])/rmse[i-1] &lt; convergenceThreshold, or i==maxIterations,
whichever earlier.
&lt;P&gt;
</p></div><dl class="paramcmts block"><dt class="tparam">K</dt><dd class="cmt"><p>row key type of the input (100 is probably more than enough)</p></dd><dt class="param">drmA</dt><dd class="cmt"><p>The input matrix</p></dd><dt class="param">k</dt><dd class="cmt"><p>required rank of decomposition (number of cols in U and V results)</p></dd><dt class="param">lambda</dt><dd class="cmt"><p>regularization rate</p></dd><dt class="param">maxIterations</dt><dd class="cmt"><p>maximum iterations to run regardless of convergence</p></dd><dt class="param">convergenceThreshold</dt><dd class="cmt"><p>stop sooner if (rmse[i-1] - rmse[i])/rmse[i - 1] is less than this
value. If &lt;=0 then we won't compute RMSE and use convergence test.</p></dd><dt>returns</dt><dd class="cmt"><p>{ @link org.apache.mahout.math.drm.decompositions.ALS.Result}
</p></dd></dl></div>
</li><li name="org.apache.mahout.math.decompositions.package#dqrThin" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="dqrThin[K](drmA:org.apache.mahout.math.drm.DrmLike[K],checkRankDeficiency:Boolean)(implicitevidence$1:scala.reflect.ClassTag[K]):(org.apache.mahout.math.drm.DrmLike[K],org.apache.mahout.math.Matrix)"></a>
<a id="dqrThin[K](DrmLike[K],Boolean)(ClassTag[K]):(DrmLike[K],Matrix)"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">dqrThin</span><span class="tparams">[<span name="K">K</span>]</span><span class="params">(<span name="drmA">drmA: <a href="../drm/DrmLike.html" class="extype" name="org.apache.mahout.math.drm.DrmLike">DrmLike</a>[<span class="extype" name="org.apache.mahout.math.decompositions.dqrThin.K">K</span>]</span>, <span name="checkRankDeficiency">checkRankDeficiency: <span class="extype" name="scala.Boolean">Boolean</span> = <span class="symbol">true</span></span>)</span><span class="params">(<span class="implicit">implicit </span><span name="arg0">arg0: <span class="extype" name="scala.reflect.ClassTag">ClassTag</span>[<span class="extype" name="org.apache.mahout.math.decompositions.dqrThin.K">K</span>]</span>)</span><span class="result">: (<a href="../drm/DrmLike.html" class="extype" name="org.apache.mahout.math.drm.DrmLike">DrmLike</a>[<span class="extype" name="org.apache.mahout.math.decompositions.dqrThin.K">K</span>], <span class="extype" name="org.apache.mahout.math.Matrix">Matrix</span>)</span>
</span>
</h4>
<p class="shortcomment cmt">Distributed _thin_ QR.</p><div class="fullcomment"><div class="comment cmt"><p>Distributed _thin_ QR. A'A must fit in a memory, i.e. if A is m x n, then n should be pretty
controlled (&lt;5000 or so). &lt;P&gt;</p><p>It is recommended to checkpoint A since it does two passes over it. &lt;P&gt;</p><p>It also guarantees that Q is partitioned exactly the same way (and in same key-order) as A, so
their RDD should be able to zip successfully.
</p></div></div>
</li><li name="org.apache.mahout.math.decompositions.package#dspca" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="dspca[K](drmA:org.apache.mahout.math.drm.DrmLike[K],k:Int,p:Int,q:Int)(implicitevidence$3:scala.reflect.ClassTag[K]):(org.apache.mahout.math.drm.DrmLike[K],org.apache.mahout.math.drm.DrmLike[Int],org.apache.mahout.math.Vector)"></a>
<a id="dspca[K](DrmLike[K],Int,Int,Int)(ClassTag[K]):(DrmLike[K],DrmLike[Int],Vector)"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">dspca</span><span class="tparams">[<span name="K">K</span>]</span><span class="params">(<span name="drmA">drmA: <a href="../drm/DrmLike.html" class="extype" name="org.apache.mahout.math.drm.DrmLike">DrmLike</a>[<span class="extype" name="org.apache.mahout.math.decompositions.dspca.K">K</span>]</span>, <span name="k">k: <span class="extype" name="scala.Int">Int</span></span>, <span name="p">p: <span class="extype" name="scala.Int">Int</span> = <span class="symbol">15</span></span>, <span name="q">q: <span class="extype" name="scala.Int">Int</span> = <span class="symbol">0</span></span>)</span><span class="params">(<span class="implicit">implicit </span><span name="arg0">arg0: <span class="extype" name="scala.reflect.ClassTag">ClassTag</span>[<span class="extype" name="org.apache.mahout.math.decompositions.dspca.K">K</span>]</span>)</span><span class="result">: (<a href="../drm/DrmLike.html" class="extype" name="org.apache.mahout.math.drm.DrmLike">DrmLike</a>[<span class="extype" name="org.apache.mahout.math.decompositions.dspca.K">K</span>], <a href="../drm/DrmLike.html" class="extype" name="org.apache.mahout.math.drm.DrmLike">DrmLike</a>[<span class="extype" name="scala.Int">Int</span>], <span class="extype" name="org.apache.mahout.math.Vector">Vector</span>)</span>
</span>
</h4>
<p class="shortcomment cmt">Distributed Stochastic PCA decomposition algorithm.</p><div class="fullcomment"><div class="comment cmt"><p>Distributed Stochastic PCA decomposition algorithm. A logical reflow of the &quot;SSVD-PCA options.pdf&quot;
document of the MAHOUT-817.
</p></div><dl class="paramcmts block"><dt class="param">drmA</dt><dd class="cmt"><p>input matrix A</p></dd><dt class="param">k</dt><dd class="cmt"><p>request SSVD rank</p></dd><dt class="param">p</dt><dd class="cmt"><p>oversampling parameter</p></dd><dt class="param">q</dt><dd class="cmt"><p>number of power iterations (hint: use either 0 or 1)</p></dd><dt>returns</dt><dd class="cmt"><p>(U,V,s). Note that U, V are non-checkpointed matrices (i.e. one needs to actually use them
e.g. save them to hdfs in order to trigger their computation.
</p></dd></dl></div>
</li><li name="org.apache.mahout.math.decompositions.package#dssvd" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="dssvd[K](drmA:org.apache.mahout.math.drm.DrmLike[K],k:Int,p:Int,q:Int)(implicitevidence$2:scala.reflect.ClassTag[K]):(org.apache.mahout.math.drm.DrmLike[K],org.apache.mahout.math.drm.DrmLike[Int],org.apache.mahout.math.Vector)"></a>
<a id="dssvd[K](DrmLike[K],Int,Int,Int)(ClassTag[K]):(DrmLike[K],DrmLike[Int],Vector)"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">dssvd</span><span class="tparams">[<span name="K">K</span>]</span><span class="params">(<span name="drmA">drmA: <a href="../drm/DrmLike.html" class="extype" name="org.apache.mahout.math.drm.DrmLike">DrmLike</a>[<span class="extype" name="org.apache.mahout.math.decompositions.dssvd.K">K</span>]</span>, <span name="k">k: <span class="extype" name="scala.Int">Int</span></span>, <span name="p">p: <span class="extype" name="scala.Int">Int</span> = <span class="symbol">15</span></span>, <span name="q">q: <span class="extype" name="scala.Int">Int</span> = <span class="symbol">0</span></span>)</span><span class="params">(<span class="implicit">implicit </span><span name="arg0">arg0: <span class="extype" name="scala.reflect.ClassTag">ClassTag</span>[<span class="extype" name="org.apache.mahout.math.decompositions.dssvd.K">K</span>]</span>)</span><span class="result">: (<a href="../drm/DrmLike.html" class="extype" name="org.apache.mahout.math.drm.DrmLike">DrmLike</a>[<span class="extype" name="org.apache.mahout.math.decompositions.dssvd.K">K</span>], <a href="../drm/DrmLike.html" class="extype" name="org.apache.mahout.math.drm.DrmLike">DrmLike</a>[<span class="extype" name="scala.Int">Int</span>], <span class="extype" name="org.apache.mahout.math.Vector">Vector</span>)</span>
</span>
</h4>
<p class="shortcomment cmt">Distributed Stochastic Singular Value decomposition algorithm.</p><div class="fullcomment"><div class="comment cmt"><p>Distributed Stochastic Singular Value decomposition algorithm.
</p></div><dl class="paramcmts block"><dt class="param">drmA</dt><dd class="cmt"><p>input matrix A</p></dd><dt class="param">k</dt><dd class="cmt"><p>request SSVD rank</p></dd><dt class="param">p</dt><dd class="cmt"><p>oversampling parameter</p></dd><dt class="param">q</dt><dd class="cmt"><p>number of power iterations</p></dd><dt>returns</dt><dd class="cmt"><p>(U,V,s). Note that U, V are non-checkpointed matrices (i.e. one needs to actually use them
e.g. save them to hdfs in order to trigger their computation.
</p></dd></dl></div>
</li><li name="org.apache.mahout.math.decompositions.package#spca" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="spca(a:org.apache.mahout.math.Matrix,k:Int,p:Int,q:Int):(org.apache.mahout.math.Matrix,org.apache.mahout.math.Matrix,org.apache.mahout.math.Vector)"></a>
<a id="spca(Matrix,Int,Int,Int):(Matrix,Matrix,Vector)"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">spca</span><span class="params">(<span name="a">a: <span class="extype" name="org.apache.mahout.math.Matrix">Matrix</span></span>, <span name="k">k: <span class="extype" name="scala.Int">Int</span></span>, <span name="p">p: <span class="extype" name="scala.Int">Int</span> = <span class="symbol">15</span></span>, <span name="q">q: <span class="extype" name="scala.Int">Int</span> = <span class="symbol">0</span></span>)</span><span class="result">: (<span class="extype" name="org.apache.mahout.math.Matrix">Matrix</span>, <span class="extype" name="org.apache.mahout.math.Matrix">Matrix</span>, <span class="extype" name="org.apache.mahout.math.Vector">Vector</span>)</span>
</span>
</h4>
<p class="shortcomment cmt">PCA based on SSVD that runs without forming an always-dense A-(colMeans(A)) input for SVD.</p><div class="fullcomment"><div class="comment cmt"><p>PCA based on SSVD that runs without forming an always-dense A-(colMeans(A)) input for SVD. This
follows the solution outlined in MAHOUT-817. For in-core version it, for most part, is supposed
to save some memory for sparse inputs by removing direct mean subtraction.&lt;P&gt;</p><p>Hint: Usually one wants to use AV which is approsimately USigma, i.e.<code>u %*%: diagv(s)</code>.
If retaining distances and orignal scaled variances not that important, the normalized PCA space
is just U.</p><p>Important: data points are considered to be rows.
</p></div><dl class="paramcmts block"><dt class="param">a</dt><dd class="cmt"><p>input matrix A</p></dd><dt class="param">k</dt><dd class="cmt"><p>request SSVD rank</p></dd><dt class="param">p</dt><dd class="cmt"><p>oversampling parameter</p></dd><dt class="param">q</dt><dd class="cmt"><p>number of power iterations</p></dd><dt>returns</dt><dd class="cmt"><p>(U,V,s)
</p></dd></dl></div>
</li><li name="org.apache.mahout.math.decompositions.package#ssvd" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="ssvd(a:org.apache.mahout.math.Matrix,k:Int,p:Int,q:Int):(org.apache.mahout.math.Matrix,org.apache.mahout.math.Matrix,org.apache.mahout.math.Vector)"></a>
<a id="ssvd(Matrix,Int,Int,Int):(Matrix,Matrix,Vector)"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">ssvd</span><span class="params">(<span name="a">a: <span class="extype" name="org.apache.mahout.math.Matrix">Matrix</span></span>, <span name="k">k: <span class="extype" name="scala.Int">Int</span></span>, <span name="p">p: <span class="extype" name="scala.Int">Int</span> = <span class="symbol">15</span></span>, <span name="q">q: <span class="extype" name="scala.Int">Int</span> = <span class="symbol">0</span></span>)</span><span class="result">: (<span class="extype" name="org.apache.mahout.math.Matrix">Matrix</span>, <span class="extype" name="org.apache.mahout.math.Matrix">Matrix</span>, <span class="extype" name="org.apache.mahout.math.Vector">Vector</span>)</span>
</span>
</h4>
<p class="shortcomment cmt">In-core SSVD algorithm.</p><div class="fullcomment"><div class="comment cmt"><p>In-core SSVD algorithm.
</p></div><dl class="paramcmts block"><dt class="param">a</dt><dd class="cmt"><p>input matrix A</p></dd><dt class="param">k</dt><dd class="cmt"><p>request SSVD rank</p></dd><dt class="param">p</dt><dd class="cmt"><p>oversampling parameter</p></dd><dt class="param">q</dt><dd class="cmt"><p>number of power iterations</p></dd><dt>returns</dt><dd class="cmt"><p>(U,V,s)
</p></dd></dl></div>
</li></ol>
</div>
</div>
<div id="inheritedMembers">
<div class="parent" name="scala.AnyRef">
<h3>Inherited from <span class="extype" name="scala.AnyRef">AnyRef</span></h3>
</div><div class="parent" name="scala.Any">
<h3>Inherited from <span class="extype" name="scala.Any">Any</span></h3>
</div>
</div>
<div id="groupedMembers">
<div class="group" name="Ungrouped">
<h3>Ungrouped</h3>
</div>
</div>
</div>
<div id="tooltip"></div>
<div id="footer"> </div>
<script defer="defer" type="text/javascript" id="jquery-js" src="../../../../../lib/jquery.js"></script><script defer="defer" type="text/javascript" id="jquery-ui-js" src="../../../../../lib/jquery-ui.js"></script><script defer="defer" type="text/javascript" id="tools-tooltip-js" src="../../../../../lib/tools.tooltip.js"></script><script defer="defer" type="text/javascript" id="template-js" src="../../../../../lib/template.js"></script>
</body>
</html>