="string">aminoacids</span>
</pre><h2 id="2">Basic call to the method, specifying the data tensor and its rank</h2><p>This uses a <i>random</i> initial guess. At each iteration, it reports the 'fit' which is defined as <tt>1-(norm(X-M)/norm(X))</tt> and is loosely the proportion of the data described by the CP model, i.e., a fit of 1 is perfect.</p><pre class="codeinput">rng(3) <span class="comment">%&lt;- Setting random seed for reproducibility of this script</span>
M1 = cp_als(X,3); <span class="comment">