qminer
Version:
A C++ based data analytics platform for processing large-scale real-time streams containing structured and unstructured data
1,219 lines (1,217 loc) • 96.9 kB
HTML
<!doctype html>
<html>
<head>
<meta name="generator" content="JSDoc 3">
<meta charset="utf-8">
<title>Module: analytics</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
<link href="css/baseline.css" rel="stylesheet">
</head>
<body onload="prettyPrint()">
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">QMiner JavaScript API v9.4.0</a>
</div>
</div>
</nav>
<div id="jsdoc-body-container">
<div id="jsdoc-content">
<div id="jsdoc-content-container">
<div id="jsdoc-main" role="main">
<header class="page-header">
<div class="symbol-detail-labels"><span class="label label-kind">module</span></div>
<h1><small></small><span class="symbol-name">analytics</span></h1>
<p class="source-link">Source: <a href="analyticsdoc.js.html#source-line-8">analyticsdoc.<wbr>js:8</a></p>
<div class="symbol-description">
<p>Analytics module.</p>
</div>
<section>
<h2>
Example
</h2>
<div>
<pre class="prettyprint"><code>// import modules
var qm = require('qminer');
var analytics = qm.analytics;
// load dataset, create model, evaluate model</code></pre>
</div>
</section>
<dl class="dl-compact">
</dl>
</header>
<section id="summary">
<div class="summary-callout">
<h2 class="summary-callout-heading">Child classes</h2>
<div class="summary-content">
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="module-analytics.BiasedGk.html">BiasedGk([arg])</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.BufferedTDigest.html">BufferedTDigest([arg])</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.DpMeans.html">DpMeans([arg])</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.Gk.html">Gk([arg])</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.KMeans.html">KMeans([arg])</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.LogReg.html">LogReg([arg])</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.MDS.html">MDS([arg])</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.NearestNeighborAD.html">NearestNeighborAD([arg])</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="module-analytics.NNet.html">NNet([arg])</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.OneVsAll.html">OneVsAll([arg])</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.PCA.html">PCA([arg])</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.PropHazards.html">PropHazards([arg])</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.RecLinReg.html">RecLinReg(arg)</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.RecommenderSys.html">RecommenderSys([arg])</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.RidgeReg.html">RidgeReg([arg])</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.Sigmoid.html">Sigmoid([arg])</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="module-analytics.SVC.html">SVC([arg])</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.SVR.html">SVR([arg])</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.TDigest.html">TDigest([arg])</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.ThresholdModel.html">ThresholdModel([arg])</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.Tokenizer.html">Tokenizer([arg])</a></dt>
<dd>
</dd>
<dt><a href="module-analytics-ActiveLearner.html">ActiveLearner([arg])</a></dt>
<dd>
</dd>
</dl>
</div>
</div>
</div>
<div class="summary-callout">
<h2 class="summary-callout-heading">Namespaces</h2>
<div class="summary-content">
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="module-analytics-metrics.html">metrics</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="module-analytics-preprocessing.html">preprocessing</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
</div>
</div>
</div>
<div class="summary-callout">
<h2 class="summary-callout-heading">Method</h2>
<div class="summary-content">
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="module-analytics.html#nmf">nmf(mat, k[, json])</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
</div>
<div class="summary-column">
</div>
</div>
</div>
<div class="summary-callout">
<h2 class="summary-callout-heading">Abstract types</h2>
<div class="summary-content">
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="module-analytics.html#~ActiveLearnerParam">ActiveLearnerParam</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.html#~BiasedGkParam">BiasedGkParam</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.html#~BufferedDigestParam">BufferedDigestParam</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.html#~detectorParam">detectorParam</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.html#~DpMeansExplain">DpMeansExplain</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.html#~DpMeansParam">DpMeansParam</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.html#~GkParam">GkParam</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.html#~hazardModelParam">hazardModelParam</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="module-analytics.html#~KMeansExplain">KMeansExplain</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.html#~KMeansParam">KMeansParam</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.html#~logisticRegParam">logisticRegParam</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.html#~MDSParam">MDSParam</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.html#~NearestNeighborADExplain">NearestNeighborADExplain</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.html#~NearestNeighborADFeatureContribution">NearestNeighborADFeatureContribution</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.html#~nnetParam">nnetParam</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.html#~oneVsAllParam">oneVsAllParam</a></dt>
<dd>
</dd>
</dl>
</div>
<div class="summary-column">
<dl class="dl-summary-callout">
<dt><a href="module-analytics.html#~PCAParam">PCAParam</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.html#~recLinRegParam">recLinRegParam</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.html#~RecSysParam">RecSysParam</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.html#~ridgeRegParam">ridgeRegParam</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.html#~SVMParam">SVMParam</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.html#~TDigestParam">TDigestParam</a></dt>
<dd>
</dd>
<dt><a href="module-analytics.html#~tokenizerParam">tokenizerParam</a></dt>
<dd>
</dd>
</dl>
</div>
</div>
</div>
</section>
<section>
<h2>Classes</h2>
<section id='members-links'>
<h3><a href="module-analytics.BiasedGk.html">BiasedGk</a></h3>
<h3><a href="module-analytics.BufferedTDigest.html">BufferedTDigest</a></h3>
<h3><a href="module-analytics.DpMeans.html">DpMeans</a></h3>
<h3><a href="module-analytics.Gk.html">Gk</a></h3>
<h3><a href="module-analytics.KMeans.html">KMeans</a></h3>
<h3><a href="module-analytics.LogReg.html">LogReg</a></h3>
<h3><a href="module-analytics.MDS.html">MDS</a></h3>
<h3><a href="module-analytics.NearestNeighborAD.html">NearestNeighborAD</a></h3>
<h3><a href="module-analytics.NNet.html">NNet</a></h3>
<h3><a href="module-analytics.OneVsAll.html">OneVsAll</a></h3>
<h3><a href="module-analytics.PCA.html">PCA</a></h3>
<h3><a href="module-analytics.PropHazards.html">PropHazards</a></h3>
<h3><a href="module-analytics.RecLinReg.html">RecLinReg</a></h3>
<h3><a href="module-analytics.RecommenderSys.html">RecommenderSys</a></h3>
<h3><a href="module-analytics.RidgeReg.html">RidgeReg</a></h3>
<h3><a href="module-analytics.Sigmoid.html">Sigmoid</a></h3>
<h3><a href="module-analytics.SVC.html">SVC</a></h3>
<h3><a href="module-analytics.SVR.html">SVR</a></h3>
<h3><a href="module-analytics.TDigest.html">TDigest</a></h3>
<h3><a href="module-analytics.ThresholdModel.html">ThresholdModel</a></h3>
<h3><a href="module-analytics.Tokenizer.html">Tokenizer</a></h3>
<h3><a href="module-analytics-ActiveLearner.html">ActiveLearner</a></h3>
</section>
<h2>Namespaces</h2>
<section id='members-links'>
<h3><a href="module-analytics-metrics.html">metrics</a></h3>
<h3><a href="module-analytics-preprocessing.html">preprocessing</a></h3>
</section>
<h2>Method</h2>
<section>
<h3 id="nmf"><span class="symbol-name">nmf</span><span class="signature"><span class="signature-params">(mat, k[, json])</span> → <span class="signature-returns"> Object</span></span></h3>
<p>Calculates the non-negative matrix factorization, see: <a href="https://en.wikipedia.org/wiki/Non-negative_matrix_factorization">https://en.wikipedia.org/wiki/Non-negative_matrix_factorization</a>.</p>
<section>
<h4>
Examples
</h4>
<div>
<p>Asynchronous function</p>
<pre class="prettyprint"><code>// import modules
var analytics = require('qminer').analytics;
var la = require('qminer').la;
// create a matrix
var mat = new la.Matrix({ rows: 10, cols: 5, random: true });
// compute the non-negative matrix factorization
analytics.nmfAsync(mat, 3, { iter: 100, tol: 1e-4 }, function (err, result) {
if (err) { console.log(err); }
// calculation successful
var U = result.U;
var V = result.V;
});</code></pre>
</div>
<div>
<p>Synchronous function</p>
<pre class="prettyprint"><code>// import modules
var analytics = require('qminer').analytics;
var la = require('qminer').la;
// create a matrix
var mat = new la.Matrix({ rows: 10, cols: 5, random: true });
// compute the non-negative matrix factorization
var result = analytics.nmf(mat, 3, { iter: 100, tol: 1e-4 });
var U = result.U;
var V = result.V;</code></pre>
</div>
</section>
<section>
<h4>Parameters</h4>
<table class="jsdoc-details-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>mat</p>
</td>
<td>
<p>(<a href="module-la.Matrix.html">module:la.Matrix</a> or <a href="module-la.SparseMatrix.html">module:la.SparseMatrix</a>)</p>
</td>
<td>
<p> </p>
</td>
<td>
<p>The non-negative matrix.</p>
</td>
</tr>
<tr>
<td>
<p>k</p>
</td>
<td>
<p>number</p>
</td>
<td>
<p> </p>
</td>
<td>
<p>The reduced rank, e.g. number of columns in matrix U and number of rows in matrix V. Must be between 0 and <code>min(mat.rows, mat.cols)</code>.</p>
</td>
</tr>
<tr>
<td>
<p>json</p>
</td>
<td>
<p>Object</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>Algorithm options.</p>
<p>Values in <code>json</code> have the following properties:</p>
<table class="jsdoc-details-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>iter</p>
</td>
<td>
<p>number</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>The number of iterations used for the algorithm.</p>
<p>Defaults to <code>100</code>.</p>
</td>
</tr>
<tr>
<td>
<p>tol</p>
</td>
<td>
<p>number</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>The tolerance.</p>
<p>Defaults to <code>1e-3</code>.</p>
</td>
</tr>
<tr>
<td>
<p>verbose</p>
</td>
<td>
<p>boolean</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>If false, the console output is supressed.</p>
<p>Defaults to <code>false</code>.</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
<dt>Returns</dt>
<dd>
<p><code>Object</code>B The json object <code>nmfRes</code> containing the non-negative matrices U and V:
<br> <code>nmfRes.U</code>- The <a href="module-la.Matrix.html">module:la.Matrix</a> representation of the matrix U,
<br> <code>nmfRes.V</code>- The <a href="module-la.Matrix.html">module:la.Matrix</a> representation of the matrix V.
</p>
</dd>
</dl>
</section>
<h2>Abstract types</h2>
<section>
<div class="symbol-detail-labels"><span class="label label-inner">inner</span></div>
<h3 id="~ActiveLearnerParam"><span class="symbol-name">ActiveLearnerParam</span><small class="property-type">
Object</small></h3>
<p>An object used for the construction of module:analytics.ActiveLearner.</p>
<section>
<h4>Properties</h4>
<table class="jsdoc-details-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>learner</p>
</td>
<td>
<p>Object</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>Learner parameters</p>
<p>Values in <code>learner</code> have the following properties:</p>
<table class="jsdoc-details-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>disableAsserts</p>
</td>
<td>
<p>boolean</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>Disable input asserting</p>
<p>Defaults to <code>false</code>.</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<p>SVC</p>
</td>
<td>
<p><a href="module-analytics.html#~SVMParam">module:analytics~SVMParam</a></p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>Support vector classifier parameters.</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
<div class="symbol-detail-labels"><span class="label label-inner">inner</span></div>
<h3 id="~BiasedGkParam"><span class="symbol-name">BiasedGkParam</span><small class="property-type">
Object</small></h3>
<p>An object used for the construction of module:analytics.quantiles.BiasedGk.</p>
<section>
<h4>Properties</h4>
<table class="jsdoc-details-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>targetProb</p>
</td>
<td>
<p>number</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>The probability where the algorithm is most accurate. Its accuracy is determined as eps<em>max(p, targetProb) when targetProb < 0.5 and eps</em>max(1-p, 1-targetProb) when targetProb >= 0.5. Higher values of <code>targetProb</code> allow for a smaller memory footprint.</p>
<p>Defaults to <code>0.01</code>.</p>
</td>
</tr>
<tr>
<td>
<p>eps</p>
</td>
<td>
<p>number</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>Parameter which determines the accuracy.</p>
<p>Defaults to <code>0.1</code>.</p>
</td>
</tr>
<tr>
<td>
<p>compression</p>
</td>
<td>
<p>string</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>Determines when the algorithm compresses its summary. Options are: "periodic", "aggressive" and "manual".</p>
<p>Defaults to <code>"periodic"</code>.</p>
</td>
</tr>
<tr>
<td>
<p>useBands</p>
</td>
<td>
<p>boolean</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>Whether the algorithm should use the 'band' subprocedure. Using this subprocedure should result in a smaller summary.</p>
<p>Defaults to <code>true</code>.</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
<div class="symbol-detail-labels"><span class="label label-inner">inner</span></div>
<h3 id="~BufferedDigestParam"><span class="symbol-name">BufferedDigestParam</span><small class="property-type">
Object</small></h3>
<p>An object used for the construction of module:analytics.quantiles.BufferedTDigest.</p>
<section>
<h4>Properties</h4>
<table class="jsdoc-details-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>delta</p>
</td>
<td>
<p>number</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>The number of clusters in the summary is bounded by floor(minClusters) <= clusters < 2*ceil(minClusters)</p>
<p>Defaults to <code>100</code>.</p>
</td>
</tr>
<tr>
<td>
<p>bufferLen</p>
</td>
<td>
<p>number</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>the size of the buffer is minClusters<em>bufferLenFactor, when the buffer fills it is merged with the summary. Also, the algorithm initializes after seeing minClusters</em>bufferLenFactor examples.</p>
<p>Defaults to <code>1000</code>.</p>
</td>
</tr>
<tr>
<td>
<p>seed</p>
</td>
<td>
<p>number</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>random seed (values above 1 are deterministic)</p>
<p>Defaults to <code>0</code>.</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
<div class="symbol-detail-labels"><span class="label label-inner">inner</span></div>
<h3 id="~detectorParam"><span class="symbol-name">detectorParam</span><small class="property-type">
Object</small></h3>
<p>An object used for the construction of <a href="module-analytics.NearestNeighborAD.html">module:analytics.NearestNeighborAD</a>.</p>
<section>
<h4>Parameters</h4>
<table class="jsdoc-details-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>rate</p>
</td>
<td>
<p>number</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>The expected fracton of emmited anomalies (0.05 -> 5% of cases will be classified as anomalies).</p>
<p>Defaults to <code>0.05</code>.</p>
</td>
</tr>
<tr>
<td>
<p>windowSize</p>
</td>
<td>
<p>number</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>Number of most recent instances kept in the model.</p>
<p>Defaults to <code>100</code>.</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
<div class="symbol-detail-labels"><span class="label label-inner">inner</span></div>
<h3 id="~DpMeansExplain"><span class="symbol-name">DpMeansExplain</span><small class="property-type">
Object</small></h3>
<p>The examplanation returned by <a href="module-analytics.KMeans.html#explain">module:analytics.KMeans#explain</a>.</p>
<section>
<h4>Properties</h4>
<table class="jsdoc-details-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>medoidID</p>
</td>
<td>
<p>number</p>
</td>
<td>
<p> </p>
</td>
<td>
<p>The ID of the nearest medoids.</p>
</td>
</tr>
<tr>
<td>
<p>featureIDs</p>
</td>
<td>
<p><a href="module-la.IntVector.html">module:la.IntVector</a></p>
</td>
<td>
<p> </p>
</td>
<td>
<p>The IDs of features, sorted by contribution.</p>
</td>
</tr>
<tr>
<td>
<p>featureContributions</p>
</td>
<td>
<p><a href="module-la.Vector.html">module:la.Vector</a></p>
</td>
<td>
<p> </p>
</td>
<td>
<p>Weights of each feature contribution (sum to 1.0).</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
<div class="symbol-detail-labels"><span class="label label-inner">inner</span></div>
<h3 id="~DpMeansParam"><span class="symbol-name">DpMeansParam</span><small class="property-type">
Object</small></h3>
<p>An object used for the construction of <a href="module-analytics.KMeans.html">module:analytics.KMeans</a>.</p>
<section>
<h4>Properties</h4>
<table class="jsdoc-details-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>iter</p>
</td>
<td>
<p>number</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>The maximum number of iterations.</p>
<p>Defaults to <code>10000</code>.</p>
</td>
</tr>
<tr>
<td>
<p>lambda</p>
</td>
<td>
<p>number</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>Maximum radius of the clusters</p>
<p>Defaults to <code>1</code>.</p>
</td>
</tr>
<tr>
<td>
<p>minClusters</p>
</td>
<td>
<p>number</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>Minimum number of clusters</p>
<p>Defaults to <code>2</code>.</p>
</td>
</tr>
<tr>
<td>
<p>maxClusters</p>
</td>
<td>
<p>number</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>Maximum number of clusters</p>
<p>Defaults to <code>inf</code>.</p>
</td>
</tr>
<tr>
<td>
<p>allowEmpty</p>
</td>
<td>
<p>boolean</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>Whether to allow empty clusters to be generated.</p>
<p>Defaults to <code>true</code>.</p>
</td>
</tr>
<tr>
<td>
<p>calcDistQual</p>
</td>
<td>
<p>boolean</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>Whether to calculate the quality measure based on distance, if false relMeanCentroidDist will return 'undefined'</p>
<p>Defaults to <code>false</code>.</p>
</td>
</tr>
<tr>
<td>
<p>centroidType</p>
</td>
<td>
<p>string</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>The type of centroids. Possible options are <code>'Dense'</code> and <code>'Sparse'</code>.</p>
<p>Defaults to <code>"Dense"</code>.</p>
</td>
</tr>
<tr>
<td>
<p>distanceType</p>
</td>
<td>
<p>string</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>The distance type used at the calculations. Possible options are <code>'Euclid'</code> and <code>'Cos'</code>.</p>
<p>Defaults to <code>"Euclid"</code>.</p>
</td>
</tr>
<tr>
<td>
<p>verbose</p>
</td>
<td>
<p>boolean</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>If <code>false</code>, the console output is supressed.</p>
<p>Defaults to <code>false</code>.</p>
</td>
</tr>
<tr>
<td>
<p>fitIdx</p>
</td>
<td>
<p>Array of number</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>The index array used for the construction of the initial centroids.</p>
</td>
</tr>
<tr>
<td>
<p>fitStart</p>
</td>
<td>
<p>Object</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>The KMeans model returned by module:analytics.KMeans.prototype.getModel used for centroid initialization.</p>
<p>Values in <code>fitStart</code> have the following properties:</p>
<table class="jsdoc-details-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>C</p>
</td>
<td>
<p>(<a href="module-la.Matrix.html">module:la.Matrix</a> or <a href="module-la.SparseMatrix.html">module:la.SparseMatrix</a>)</p>
</td>
<td>
<p> </p>
</td>
<td>
<p>The centroid matrix.</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
<div class="symbol-detail-labels"><span class="label label-inner">inner</span></div>
<h3 id="~GkParam"><span class="symbol-name">GkParam</span><small class="property-type">
Object</small></h3>
<p>An object used for the construction of module:analytics.quantiles.Gk.</p>
<section>
<h4>Properties</h4>
<table class="jsdoc-details-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>eps</p>
</td>
<td>
<p>number</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>Determines the relative error of the algorithm.</p>
<p>Defaults to <code>0.01</code>.</p>
</td>
</tr>
<tr>
<td>
<p>autoCompress</p>
</td>
<td>
<p>boolean</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>Whether the summary should be compresses automatically or manually.</p>
<p>Defaults to <code>true</code>.</p>
</td>
</tr>
<tr>
<td>
<p>useBands</p>
</td>
<td>
<p>boolean</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>Whether the algorithm should use the 'band' subprocedure. Using this subprocedure should result in a smaller summary.</p>
<p>Defaults to <code>true</code>.</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
<div class="symbol-detail-labels"><span class="label label-inner">inner</span></div>
<h3 id="~hazardModelParam"><span class="symbol-name">hazardModelParam</span><small class="property-type">
Object</small></h3>
<p>An object used for the construction of <a href="module-analytics.PropHazards.html">module:analytics.PropHazards</a>.</p>
<section>
<h4>Property</h4>
<table class="jsdoc-details-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>lambda</p>
</td>
<td>
<p>number</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>The regularization parameter.</p>
<p>Defaults to <code>0</code>.</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
<div class="symbol-detail-labels"><span class="label label-inner">inner</span></div>
<h3 id="~KMeansExplain"><span class="symbol-name">KMeansExplain</span><small class="property-type">
Object</small></h3>
<p>The examplanation returned by <a href="module-analytics.KMeans.html#explain">module:analytics.KMeans#explain</a>.</p>
<section>
<h4>Properties</h4>
<table class="jsdoc-details-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>medoidID</p>
</td>
<td>
<p>number</p>
</td>
<td>
<p> </p>
</td>
<td>
<p>The ID of the nearest medoids.</p>
</td>
</tr>
<tr>
<td>
<p>featureIDs</p>
</td>
<td>
<p><a href="module-la.IntVector.html">module:la.IntVector</a></p>
</td>
<td>
<p> </p>
</td>
<td>
<p>The IDs of features, sorted by contribution.</p>
</td>
</tr>
<tr>
<td>
<p>featureContributions</p>
</td>
<td>
<p><a href="module-la.Vector.html">module:la.Vector</a></p>
</td>
<td>
<p> </p>
</td>
<td>
<p>Weights of each feature contribution (sum to 1.0).</p>
</td>
</tr>
</tbody>
</table>
</section>
<dl class="dl-compact">
</dl>
<div class="symbol-detail-labels"><span class="label label-inner">inner</span></div>
<h3 id="~KMeansParam"><span class="symbol-name">KMeansParam</span><small class="property-type">
Object</small></h3>
<p>An object used for the construction of <a href="module-analytics.KMeans.html">module:analytics.KMeans</a>.</p>
<section>
<h4>Properties</h4>
<table class="jsdoc-details-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Optional</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>iter</p>
</td>
<td>
<p>number</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>The maximum number of iterations.</p>
<p>Defaults to <code>10000</code>.</p>
</td>
</tr>
<tr>
<td>
<p>k</p>
</td>
<td>
<p>number</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p>The number of centroids.</p>
<p>Defaults to <code>2</code>.</p>
</td>
</tr>
<tr>
<td>
<p>allowEmpty</p>
</td>
<td>
<p>boolean</p>
</td>
<td>
<p>Yes</p>
</td>
<t