UNPKG

qminer

Version:

A C++ based data analytics platform for processing large-scale real-time streams containing structured and unstructured data

2,064 lines (1,485 loc) 281 kB
<!doctype html> <html> <head> <meta name="generator" content="JSDoc 3"> <meta charset="utf-8"> <title>Module: qm</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">qm</span></h1> <p class="source-link">Source: <a href="qminerdoc.js.html#source-line-8">qminerdoc.<wbr>js:8</a></p> <div class="symbol-description"> <p>QMiner module.</p> </div> <section> <h2> Example </h2> <div> <pre class="prettyprint"><code>// import module var qm &#x3D; require(&#x27;qminer&#x27;);</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-qm.Base.html">Base(paramObj)</a></dt> <dd> </dd> <dt><a href="module-qm.CircularRecordBuffer.html">CircularRecordBuffer([params])</a></dt> <dd> </dd> <dt><a href="module-qm.FeatureSpace.html">FeatureSpace(base, arg)</a></dt> <dd> </dd> </dl> </div> <div class="summary-column"> <dl class="dl-summary-callout"> <dt><a href="module-qm.Iterator.html">Iterator()</a></dt> <dd> </dd> <dt><a href="module-qm.Record.html">Record()</a></dt> <dd> </dd> <dt><a href="module-qm.RecordSet.html">RecordSet()</a></dt> <dd> </dd> </dl> </div> <div class="summary-column"> <dl class="dl-summary-callout"> <dt><a href="module-qm.RecordVector.html">RecordVector(base[, fin])</a></dt> <dd> </dd> <dt><a href="module-qm.Store.html">Store()</a></dt> <dd> </dd> <dt><a href="module-qm.StreamAggr.html">StreamAggr(base, arg[, storeName])</a></dt> <dd> </dd> </dl> </div> </div> </div> <div class="summary-callout"> <h2 class="summary-callout-heading">Properties</h2> <div class="summary-content"> <div class="summary-column"> <dl class="dl-summary-callout"> <dt><a href="module-qm.html#.flags">flags</a></dt> <dd> </dd> </dl> </div> <div class="summary-column"> <dl class="dl-summary-callout"> <dt><a href="module-qm.html#.version">version</a></dt> <dd> </dd> </dl> </div> <div class="summary-column"> </div> </div> </div> <div class="summary-callout"> <h2 class="summary-callout-heading">Methods</h2> <div class="summary-content"> <div class="summary-column"> <dl class="dl-summary-callout"> <dt><a href="module-qm.html#.config">config([configPath][, overwrite][, portN][, cacheSize])</a></dt> <dd> </dd> <dt><a href="module-qm.html#.create">create([configPath][, schemaPath][, clear])</a></dt> <dd> </dd> </dl> </div> <div class="summary-column"> <dl class="dl-summary-callout"> <dt><a href="module-qm.html#.open">open([configPath][, readOnly])</a></dt> <dd> </dd> <dt><a href="module-qm.html#.stats">stats()</a></dt> <dd> </dd> </dl> </div> <div class="summary-column"> <dl class="dl-summary-callout"> <dt><a href="module-qm.html#.verbosity">verbosity([level])</a></dt> <dd> </dd> </dl> </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-qm.html#~BaseConstructorParam">BaseConstructorParam</a></dt> <dd> </dd> <dt><a href="module-qm.html#~BaseLoadCSVParam">BaseLoadCSVParam</a></dt> <dd> </dd> <dt><a href="module-qm.html#~DetailKeyObject">DetailKeyObject</a></dt> <dd> </dd> <dt><a href="module-qm.html#~FeatureExtractor">FeatureExtractor</a></dt> <dd> </dd> <dt><a href="module-qm.html#~FeatureExtractorCategorical">FeatureExtractorCategorical</a></dt> <dd> </dd> <dt><a href="module-qm.html#~FeatureExtractorConstant">FeatureExtractorConstant</a></dt> <dd> </dd> <dt><a href="module-qm.html#~FeatureExtractorDateWindow">FeatureExtractorDateWindow</a></dt> <dd> </dd> <dt><a href="module-qm.html#~FeatureExtractorJoin">FeatureExtractorJoin</a></dt> <dd> </dd> <dt><a href="module-qm.html#~FeatureExtractorJsfunc">FeatureExtractorJsfunc</a></dt> <dd> </dd> <dt><a href="module-qm.html#~FeatureExtractorMultinomial">FeatureExtractorMultinomial</a></dt> <dd> </dd> <dt><a href="module-qm.html#~FeatureExtractorNumeric">FeatureExtractorNumeric</a></dt> <dd> </dd> <dt><a href="module-qm.html#~FeatureExtractorPair">FeatureExtractorPair</a></dt> <dd> </dd> <dt><a href="module-qm.html#~FeatureExtractorRandom">FeatureExtractorRandom</a></dt> <dd> </dd> <dt><a href="module-qm.html#~FeatureExtractorSparseVector">FeatureExtractorSparseVector</a></dt> <dd> </dd> <dt><a href="module-qm.html#~FeatureExtractorText">FeatureExtractorText</a></dt> <dd> </dd> <dt><a href="module-qm.html#~FeatureTokenizer">FeatureTokenizer</a></dt> <dd> </dd> <dt><a href="module-qm.html#~PerformanceStat">PerformanceStat</a></dt> <dd> </dd> <dt><a href="module-qm.html#~PerformanceStatBase">PerformanceStatBase</a></dt> <dd> </dd> <dt><a href="module-qm.html#~PerformanceStatStore">PerformanceStatStore</a></dt> <dd> </dd> </dl> </div> <div class="summary-column"> <dl class="dl-summary-callout"> <dt><a href="module-qm.html#~QMinerFlags">QMinerFlags</a></dt> <dd> </dd> <dt><a href="module-qm.html#~QueryObject">QueryObject</a></dt> <dd> </dd> <dt><a href="module-qm.html#~SchemaDef">SchemaDef</a></dt> <dd> </dd> <dt><a href="module-qm.html#~SchemaFieldDef">SchemaFieldDef</a></dt> <dd> </dd> <dt><a href="module-qm.html#~SchemaJoinDef">SchemaJoinDef</a></dt> <dd> </dd> <dt><a href="module-qm.html#~SchemaKeyDef">SchemaKeyDef</a></dt> <dd> </dd> <dt><a href="module-qm.html#~SchemaTimeWindowDef">SchemaTimeWindowDef</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrAggrResampler">StreamAggrAggrResampler</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrAnomalyDetectorNN">StreamAggrAnomalyDetectorNN</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggregator">StreamAggregator</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrEMA">StreamAggrEMA</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrEMASpVec">StreamAggrEMASpVec</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrFeatureSpace">StreamAggrFeatureSpace</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrHistogram">StreamAggrHistogram</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrMax">StreamAggrMax</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrMerger">StreamAggrMerger</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrMin">StreamAggrMin</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrMovingAverage">StreamAggrMovingAverage</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrMovingCorrelation">StreamAggrMovingCorrelation</a></dt> <dd> </dd> </dl> </div> <div class="summary-column"> <dl class="dl-summary-callout"> <dt><a href="module-qm.html#~StreamAggrMovingCovariance">StreamAggrMovingCovariance</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrMovingVariance">StreamAggrMovingVariance</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrPageHinkley">StreamAggrPageHinkley</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrRecordBuffer">StreamAggrRecordBuffer</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrRecordSwitch">StreamAggrRecordSwitch</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrResampler">StreamAggrResampler</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrSimpleLinearRegression">StreamAggrSimpleLinearRegression</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrSimpleLinearRegressionResult">StreamAggrSimpleLinearRegressionResult</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrSlottedHistogram">StreamAggrSlottedHistogram</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrSparseVecSum">StreamAggrSparseVecSum</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrSum">StreamAggrSum</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrTDigest">StreamAggrTDigest</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrThreshold">StreamAggrThreshold</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrTimeSeriesTick">StreamAggrTimeSeriesTick</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrTimeSeriesWindow">StreamAggrTimeSeriesWindow</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrTimeSeriesWindowVector">StreamAggrTimeSeriesWindowVector</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrVecDiff">StreamAggrVecDiff</a></dt> <dd> </dd> <dt><a href="module-qm.html#~StreamAggrWindowQuantiles">StreamAggrWindowQuantiles</a></dt> <dd> </dd> </dl> </div> </div> </div> </section> <section> <h2>Classes</h2> <section id='members-links'> <h3><a href="module-qm.Base.html">Base</a></h3> <h3><a href="module-qm.CircularRecordBuffer.html">CircularRecordBuffer</a></h3> <h3><a href="module-qm.FeatureSpace.html">FeatureSpace</a></h3> <h3><a href="module-qm.Iterator.html">Iterator</a></h3> <h3><a href="module-qm.Record.html">Record</a></h3> <h3><a href="module-qm.RecordSet.html">RecordSet</a></h3> <h3><a href="module-qm.RecordVector.html">RecordVector</a></h3> <h3><a href="module-qm.Store.html">Store</a></h3> <h3><a href="module-qm.StreamAggr.html">StreamAggr</a></h3> </section> <h2>Properties</h2> <section> <div class="symbol-detail-labels"><span class="label label-static">static</span></div><h3 id=".flags"><span class="symbol-name">flags</span></h3> <p>Returns an object with all compile flags. Type <a href="module-qm.html#~QMinerFlags">module:qm~QMinerFlags</a>.</p> <section> <h4> Example </h4> <div> <pre class="prettyprint"><code>// import qm module var qm &#x3D; require(&#x27;qminer&#x27;); // get the compile flags var flags &#x3D; qm.flags;</code></pre> </div> </section> <dl class="dl-compact"> </dl> <div class="symbol-detail-labels"><span class="label label-static">static</span></div><h3 id=".version"><span class="symbol-name">version</span></h3> <p>Returns the module version.</p> <section> <h4> Example </h4> <div> <pre class="prettyprint"><code>// import qm module var qm &#x3D; require(&#x27;qminer&#x27;); // get the module version var version &#x3D; qm.version;</code></pre> </div> </section> <dl class="dl-compact"> <dt>Returns</dt> <dd><p><code>string</code>B The module version.</p></dd> </dl> </section> <h2>Methods</h2> <section> <div class="symbol-detail-labels"><span class="label label-static">static</span></div><h3 id=".config"><span class="symbol-name">config</span><span class="signature"><span class="signature-params">([configPath][, overwrite][, portN][, cacheSize])</span></span></h3> <p>Creates a directory structure.</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>configPath</p> </td> <td> <p>string</p> </td> <td> <p>Yes</p> </td> <td> <p>The path to configuration file.</p> <p>Defaults to <code>'qm.conf'</code>.</p> </td> </tr> <tr> <td> <p>overwrite</p> </td> <td> <p>boolean</p> </td> <td> <p>Yes</p> </td> <td> <p>If you want to overwrite the configuration file.</p> <p>Defaults to <code>false</code>.</p> </td> </tr> <tr> <td> <p>portN</p> </td> <td> <p>number</p> </td> <td> <p>Yes</p> </td> <td> <p>The number of the port. Currently not used.</p> <p>Defaults to <code>8080</code>.</p> </td> </tr> <tr> <td> <p>cacheSize</p> </td> <td> <p>number</p> </td> <td> <p>Yes</p> </td> <td> <p>Sets available memory for indexing (in MB).</p> <p>Defaults to <code>1024</code>.</p> </td> </tr> </tbody> </table> </section> <dl class="dl-compact"> </dl> <div class="symbol-detail-labels"><span class="label label-static">static</span></div><h3 id=".create"><span class="symbol-name">create</span><span class="signature"><span class="signature-params">([configPath][, schemaPath][, clear])</span>&nbsp;&rarr; <span class="signature-returns"> <a href="module-qm.Base.html">module:qm.Base</a></span></span></h3> <p>Creates an empty base.</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>configPath</p> </td> <td> <p>string</p> </td> <td> <p>Yes</p> </td> <td> <p>Configuration file path.</p> <p>Defaults to <code>'qm.conf'</code>.</p> </td> </tr> <tr> <td> <p>schemaPath</p> </td> <td> <p>string</p> </td> <td> <p>Yes</p> </td> <td> <p>Schema file path.</p> <p>Defaults to <code>''</code>.</p> </td> </tr> <tr> <td> <p>clear</p> </td> <td> <p>boolean</p> </td> <td> <p>Yes</p> </td> <td> <p>Clear the existing db folder.</p> <p>Defaults to <code>false</code>.</p> </td> </tr> </tbody> </table> </section> <dl class="dl-compact"> <dt>Returns</dt> <dd><p><code><a href="module-qm.Base.html">module:qm.Base</a></code>B The newly created base.</p></dd> </dl> <div class="symbol-detail-labels"><span class="label label-static">static</span></div><h3 id=".open"><span class="symbol-name">open</span><span class="signature"><span class="signature-params">([configPath][, readOnly])</span>&nbsp;&rarr; <span class="signature-returns"> <a href="module-qm.Base.html">module:qm.Base</a></span></span></h3> <p>Opens a base.</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>configPath</p> </td> <td> <p>string</p> </td> <td> <p>Yes</p> </td> <td> <p>The configuration file path.</p> <p>Defaults to <code>'qm.conf'</code>.</p> </td> </tr> <tr> <td> <p>readOnly</p> </td> <td> <p>boolean</p> </td> <td> <p>Yes</p> </td> <td> <p>Open in read-only mode.</p> <p>Defaults to <code>false</code>.</p> </td> </tr> </tbody> </table> </section> <dl class="dl-compact"> <dt>Returns</dt> <dd><p><code><a href="module-qm.Base.html">module:qm.Base</a></code>B The loaded base.</p></dd> </dl> <div class="symbol-detail-labels"><span class="label label-static">static</span></div><h3 id=".stats"><span class="symbol-name">stats</span><span class="signature"><span class="signature-params">()</span></span></h3> <p>Returns an JSON with two properties: &quot;byClass&quot; and &quot;total&quot;. The &quot;byClass&quot; value is a JSON where each key is a class ID and each value is of the form { newFromCpp: number, newFromJs: number, destructorCalls: number} and the value of &quot;total&quot; is of the same form (aggregated over &quot;byClass&quot;)</p> <dl class="dl-compact"> </dl> <div class="symbol-detail-labels"><span class="label label-static">static</span></div><h3 id=".verbosity"><span class="symbol-name">verbosity</span><span class="signature"><span class="signature-params">([level])</span></span></h3> <p>Set verbosity of QMiner internals.</p> <section> <h4>Parameter</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>level</p> </td> <td> <p>number</p> </td> <td> <p>Yes</p> </td> <td> <p>verbosity level. Possible options: <br>1. <code>0</code> - No output, <br>2. <code>1</code> - Log output, <br>3. <code>2</code> - Log and debug output.</p> <p>Defaults to <code>0</code>.</p> </td> </tr> </tbody> </table> </section> <dl class="dl-compact"> </dl> </section> <h2>Abstract types</h2> <section> <div class="symbol-detail-labels"><span class="label label-inner">inner</span></div><h3 id="~BaseConstructorParam"><span class="symbol-name">BaseConstructorParam</span><small class="property-type"> &nbsp;Object</small></h3> <p>Base constructor parameter used for <a href="module-qm.Base.html">module:qm.Base</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>mode</p> </td> <td> <p>string</p> </td> <td> <p>Yes</p> </td> <td> <p>Base access mode. Can be one of the following: <br>1. <code>'create'</code> - Sets up the db folder, <br>2. <code>'createClean'</code> - Cleans db folder and then sets it up, <br>3. <code>'open'</code> - Opens the db with read/write permissions, <br>4. <code>'openReadOnly'</code> - Opens the db in read only mode.</p> <p>Defaults to <code>'openReadOnly'</code>.</p> </td> </tr> <tr> <td> <p>indexCache</p> </td> <td> <p>number</p> </td> <td> <p>Yes</p> </td> <td> <p>The ammount of memory reserved for indexing (in MB).</p> <p>Defaults to <code>1024</code>.</p> </td> </tr> <tr> <td> <p>storeCache</p> </td> <td> <p>number</p> </td> <td> <p>Yes</p> </td> <td> <p>The ammount of memory reserved for store cache (in MB).</p> <p>Defaults to <code>1024</code>.</p> </td> </tr> <tr> <td> <p>schemaPath</p> </td> <td> <p>string</p> </td> <td> <p>Yes</p> </td> <td> <p>The path to schema definition file.</p> <p>Defaults to <code>''</code>.</p> </td> </tr> <tr> <td> <p>schema</p> </td> <td> <p>Array of <a href="module-qm.html#~SchemaDef">module:qm~SchemaDef</a></p> </td> <td> <p>Yes</p> </td> <td> <p>Schema definition object array.</p> <p>Defaults to <code>[]</code>.</p> </td> </tr> <tr> <td> <p>dbPath</p> </td> <td> <p>string</p> </td> <td> <p>Yes</p> </td> <td> <p>The path to db directory.</p> <p>Defaults to <code>'./db/'</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="~BaseLoadCSVParam"><span class="symbol-name">BaseLoadCSVParam</span><small class="property-type"> &nbsp;object</small></h3> <p>The parameter given to <a href="module-qm.Base.html#loadCSV">module:qm.Base#loadCSV</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>file</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The name of the input file.</p> </td> </tr> <tr> <td> <p>store</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>Name of the store which will be created.</p> </td> </tr> <tr> <td> <p>base</p> </td> <td> <p><a href="module-qm.Base.html">module:qm.Base</a></p> </td> <td> <p>&nbsp;</p> </td> <td> <p>QMiner base object that creates the store.</p> </td> </tr> <tr> <td> <p>delimiter</p> </td> <td> <p>string</p> </td> <td> <p>Yes</p> </td> <td> <p>Optional delimiter.</p> <p>Defaults to <code>','</code>.</p> </td> </tr> <tr> <td> <p>quote</p> </td> <td> <p>string</p> </td> <td> <p>Yes</p> </td> <td> <p>Optional character to escape values that contain a delimiter.</p> <p>Defaults to <code>'"'</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="~DetailKeyObject"><span class="symbol-name">DetailKeyObject</span><small class="property-type"> &nbsp;object</small></h3> <p>The details about the key object used in <a href="module-qm.Store.html#key">module:qm.Store#key</a> and <a href="module-qm.Store.html#keys">module:qm.Store#keys</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>fq</p> </td> <td> <p><a href="module-la.IntVector.html">module:la.IntVector</a></p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The frequency.</p> </td> </tr> <tr> <td> <p>vocabulary</p> </td> <td> <p><a href="module-la.StrVector.html">module:la.StrVector</a></p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The vocabulary.</p> </td> </tr> <tr> <td> <p>name</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The key name.</p> </td> </tr> <tr> <td> <p>store</p> </td> <td> <p><a href="module-qm.Store.html">module:qm.Store</a></p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The store.</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="~FeatureExtractor"><span class="symbol-name">FeatureExtractor</span><small class="property-type"> &nbsp;Object</small></h3> <p>Feature extractor types. Used for constructing <a href="module-qm.FeatureSpace.html">module:qm.FeatureSpace</a> objects.</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>constant</p> </td> <td> <p><a href="module-qm.html#~FeatureExtractorConstant">module:qm~FeatureExtractorConstant</a></p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The constant type. Adds a constant value as a feature.</p> </td> </tr> <tr> <td> <p>random</p> </td> <td> <p><a href="module-qm.html#~FeatureExtractorRandom">module:qm~FeatureExtractorRandom</a></p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The random type. Adds a random value as a feature.</p> </td> </tr> <tr> <td> <p>numeric</p> </td> <td> <p><a href="module-qm.html#~FeatureExtractorNumeric">module:qm~FeatureExtractorNumeric</a></p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The numeric type. Adds the numeric value as a feature.</p> </td> </tr> <tr> <td> <p>categorical</p> </td> <td> <p><a href="module-qm.html#~FeatureExtractorCategorical">module:qm~FeatureExtractorCategorical</a></p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The categorical type.</p> </td> </tr> <tr> <td> <p>multinomial</p> </td> <td> <p><a href="module-qm.html#~FeatureExtractorMultinomial">module:qm~FeatureExtractorMultinomial</a></p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The multinomial type.</p> </td> </tr> <tr> <td> <p>text</p> </td> <td> <p><a href="module-qm.html#~FeatureExtractorText">module:qm~FeatureExtractorText</a></p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The text type. Creates the bag-of-words text representation.</p> </td> </tr> <tr> <td> <p>join</p> </td> <td> <p><a href="module-qm.html#~FeatureExtractorJoin">module:qm~FeatureExtractorJoin</a></p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The join type.</p> </td> </tr> <tr> <td> <p>pair</p> </td> <td> <p><a href="module-qm.html#~FeatureExtractorPair">module:qm~FeatureExtractorPair</a></p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The pair type.</p> </td> </tr> <tr> <td> <p>jsfunc</p> </td> <td> <p><a href="module-qm.html#~FeatureExtractorJsfunc">module:qm~FeatureExtractorJsfunc</a></p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The jsfunc type. Allows creating a custom feature extractor.</p> </td> </tr> <tr> <td> <p>dateWindow</p> </td> <td> <p><a href="module-qm.html#~FeatureExtractorDateWindow">module:qm~FeatureExtractorDateWindow</a></p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The date window type.</p> </td> </tr> <tr> <td> <p>sparseVector</p> </td> <td> <p><a href="module-qm.html#~FeatureExtractorSparseVector">module:qm~FeatureExtractorSparseVector</a></p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The sparse vector type.</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="~FeatureExtractorCategorical"><span class="symbol-name">FeatureExtractorCategorical</span><small class="property-type"> &nbsp;Object</small></h3> <p>The feature extractor of type <code>'categorical'</code>. Used for constructing <a href="module-qm.FeatureSpace.html">module:qm.FeatureSpace</a> objects.</p> <section> <h4> Example </h4> <div> <pre class="prettyprint"><code>var qm &#x3D; require(&#x27;qminer&#x27;); // create a simple base, where each record contains the student name and it&#x27;s study group // here we know the student is part of only one study group var base &#x3D; new qm.Base({ mode: &#x27;createClean&#x27;, schema: [{ name: &quot;Class&quot;, fields: [ { name: &quot;Name&quot;, type: &quot;string&quot; }, { name: &quot;StudyGroup&quot;, type: &quot;string&quot; } ] }] }); // create a feature space containing the categorical extractor, where it&#x27;s values // are taken from the field &quot;StudyGroup&quot;: &quot;A&quot;, &quot;B&quot;, &quot;C&quot; and &quot;D&quot; var ftr &#x3D; new qm.FeatureSpace(base, { type: &quot;categorical&quot;, source: &quot;Class&quot;, field: &quot;StudyGroup&quot; }); // add a few records to the store base.store(&quot;Class&quot;).push({ Name: &quot;Fred&quot;, StudyGroup: &quot;A&quot; }); base.store(&quot;Class&quot;).push({ Name: &quot;Wilma&quot;, StudyGroup: &quot;B&quot; }); base.store(&quot;Class&quot;).push({ Name: &quot;Barney&quot;, StudyGroup: &quot;C&quot; }); // update the feature space to get the categories ftr.updateRecords(base.store(&quot;Class&quot;).allRecords); // get the feature vector for the first record var vec &#x3D; ftr.extractVector(base.store(&quot;Class&quot;)[0]); // returns vector [1, 0, 0] base.close();</code></pre> </div> </section> <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>type</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The type of the extractor. <b>Important</b>: It must be equal <code>'categorical'</code>.</p> </td> </tr> <tr> <td> <p>values</p> </td> <td> <p>Array of Object</p> </td> <td> <p>Yes</p> </td> <td> <p>A fixed set of values, which form a fixed feature set. No dimensionality changes if new values are seen in the upgrades.</p> </td> </tr> <tr> <td> <p>hashDimension</p> </td> <td> <p>number</p> </td> <td> <p>Yes</p> </td> <td> <p>A hashing code to set the fixed dimensionality. All values are hashed and divided modulo hasDimension to get the corresponding dimension.</p> </td> </tr> <tr> <td> <p>field</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The name of the field form which to take the values.</p> </td> </tr> <tr> <td> <p>source</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The store name.</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="~FeatureExtractorConstant"><span class="symbol-name">FeatureExtractorConstant</span><small class="property-type"> &nbsp;Object</small></h3> <p>The feature extractor of type <code>'contant'</code>. Used for constructing <a href="module-qm.FeatureSpace.html">module:qm.FeatureSpace</a> objects.</p> <section> <h4> Example </h4> <div> <pre class="prettyprint"><code>var qm &#x3D; require(&#x27;qminer&#x27;); // create a simple base, where each record contains only a persons name var base &#x3D; new qm.Base({ mode: &#x27;createClean&#x27;, schema: [{ name: &quot;Person&quot;, fields: [{ name: &quot;Name&quot;, type: &quot;string&quot; }] }] }); // create a feature space containing the constant extractor, where the constant is equal 5 var ftr &#x3D; new qm.FeatureSpace(base, { type: &quot;constant&quot;, source: &quot;Person&quot;, const: 5 }); // add a new record to the base base.store(&quot;Person&quot;).push({ Name: &quot;Peterson&quot; }); // get the features of the record var vec &#x3D; ftr.extractVector(base.store(&quot;Person&quot;)[0]); // the vector [5] base.close();</code></pre> </div> </section> <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>type</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The type of the extractor. <b>Important</b>: It must be equal <code>'constant'</code>.</p> </td> </tr> <tr> <td> <p>const</p> </td> <td> <p>number</p> </td> <td> <p>Yes</p> </td> <td> <p>A constant number.</p> <p>Defaults to <code>1.0</code>.</p> </td> </tr> <tr> <td> <p>source</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The store name.</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="~FeatureExtractorDateWindow"><span class="symbol-name">FeatureExtractorDateWindow</span><small class="property-type"> &nbsp;Object</small></h3> <p>The feature extractor of type <code>'dateWindow'</code>. Used for constructing <a href="module-qm.FeatureSpace.html">module:qm.FeatureSpace</a> objects.</p> <section> <h4> Example </h4> <div> <pre class="prettyprint"><code>// import qm module var qm &#x3D; require(&#x27;qminer&#x27;);</code></pre> </div> </section> <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>type</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The type of the extractor. <b>Important</b>: It must be equal <code>'dateWindow'</code>.</p> </td> </tr> <tr> <td> <p>unit</p> </td> <td> <p>string</p> </td> <td> <p>Yes</p> </td> <td> <p>How granular is the time window. Possible options are <code>'day'</code>, <code>'week'</code>, <code>'month'</code>, <code>'year'</code>, <code>'12hours'</code>, <code>'6hours'</code>, <code>'4hours'</code>, <code>'2hours'</code>, <code>'hour'</code>, <code>'30minutes'</code>, <code>'15minutes'</code>, <code>'10minutes'</code>, <code>'minute'</code>, <code>'second'</code>.</p> <p>Defaults to <code>'day'</code>.</p> </td> </tr> <tr> <td> <p>window</p> </td> <td> <p>number</p> </td> <td> <p>Yes</p> </td> <td> <p>The size of the window.</p> <p>Defaults to <code>1</code>.</p> </td> </tr> <tr> <td> <p>normalize</p> </td> <td> <p>boolean</p> </td> <td> <p>Yes</p> </td> <td> <p>Normalize the resulting vector of the extractor to have L2 norm 1.0.</p> <p>Defaults to <code>'false'</code>.</p> </td> </tr> <tr> <td> <p>start</p> </td> <td> <p>number</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>//TODO</p> </td> </tr> <tr> <td> <p>end</p> </td> <td> <p>number</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>//TODO</p> </td> </tr> <tr> <td> <p>source</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The store name.</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="~FeatureExtractorJoin"><span class="symbol-name">FeatureExtractorJoin</span><small class="property-type"> &nbsp;Object</small></h3> <p>The feature extractor of type <code>'join'</code>. Used for constructing <a href="module-qm.FeatureSpace.html">module:qm.FeatureSpace</a> objects.</p> <section> <h4> Example </h4> <div> <pre class="prettyprint"><code>// import qm module var qm &#x3D; require(&#x27;qminer&#x27;);</code></pre> </div> </section> <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>type</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The type of the extractor. <b>Important</b>: It must be equal <code>'join'</code>.</p> </td> </tr> <tr> <td> <p>bucketSize</p> </td> <td> <p>number</p> </td> <td> <p>Yes</p> </td> <td> <p>The size of the bucket in which we group consecutive records.</p> <p>Defaults to <code>1</code>.</p> </td> </tr> <tr> <td> <p>source</p> </td> <td> <p>string</p> </td> <td> <p>&nbsp;</p> </td> <td> <p>The store name.</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="~FeatureExtractorJsfunc"><span class="symbol-name">FeatureExtractorJsfunc</span><small class="property-type"> &nbsp;Object</small></h3> <p>The feature extractor of type <code>'jsfunc'</code>. Used for constructing <a href="module-qm.FeatureSpace.html">module:qm.FeatureSpace</a> objects.</p> <section> <h4> Example </h4> <div> <pre class="prettyprint"><code>var qm &#x3D; require(&#x27;qminer&#x27;); // create a simple base, where each record contains the name of the student and his study groups // each student is part of multiple study groups var base &#x3D; new qm.Base({ mode: &#x27;createClean&#x27;, schema: [{ name: &quot;Class&quot;, fields: [ { name: &quot;Name&quot;, type: &quot;string&quot; }, { name: &quot;StudyGroups&quot;, type