UNPKG

@modelx/modelx

Version:

Construct AI & ML models with JSON using Typescript & Tensorflow

710 lines 126 kB
<!doctype html> <html class="default no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>&quot;node_modules/@modelx/data/src/util&quot; | @modelx/data</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="../assets/css/main.css"> </head> <body> <header> <div class="tsd-page-toolbar"> <div class="container"> <div class="table-wrap"> <div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base=".."> <div class="field"> <label for="tsd-search-field" class="tsd-widget search no-caption">Search</label> <input id="tsd-search-field" type="text" /> </div> <ul class="results"> <li class="state loading">Preparing search index...</li> <li class="state failure">The search index is not available</li> </ul> <a href="../index.html" class="title">@modelx/data</a> </div> <div class="table-cell" id="tsd-widgets"> <div id="tsd-filter"> <a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a> <div class="tsd-filter-group"> <div class="tsd-select" id="tsd-filter-visibility"> <span class="tsd-select-label">All</span> <ul class="tsd-select-list"> <li data-value="public">Public</li> <li data-value="protected">Public/Protected</li> <li data-value="private" class="selected">All</li> </ul> </div> <input type="checkbox" id="tsd-filter-inherited" checked /> <label class="tsd-widget" for="tsd-filter-inherited">Inherited</label> <input type="checkbox" id="tsd-filter-externals" checked /> <label class="tsd-widget" for="tsd-filter-externals">Externals</label> <input type="checkbox" id="tsd-filter-only-exported" /> <label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label> </div> </div> <a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a> </div> </div> </div> </div> <div class="tsd-page-title"> <div class="container"> <ul class="tsd-breadcrumb"> <li> <a href="../globals.html">Globals</a> </li> <li> <a href="_node_modules__modelx_data_src_util_.html">&quot;node_modules/@modelx/data/src/util&quot;</a> </li> </ul> <h1>External module &quot;node_modules/@modelx/data/src/util&quot;</h1> </div> </div> </header> <div class="container container-main"> <div class="row"> <div class="col-8 col-content"> <section class="tsd-panel-group tsd-index-group"> <h2>Index</h2> <section class="tsd-panel tsd-index-panel"> <div class="tsd-index-content"> <section class="tsd-index-section "> <h3>Interfaces</h3> <ul class="tsd-index-list"> <li class="tsd-kind-interface tsd-parent-kind-external-module"><a href="../interfaces/_node_modules__modelx_data_src_util_.arraycalculation.html" class="tsd-kind-icon">Array<wbr>Calculation</a></li> <li class="tsd-kind-interface tsd-parent-kind-external-module"><a href="../interfaces/_node_modules__modelx_data_src_util_.arraysort.html" class="tsd-kind-icon">Array<wbr>Sort</a></li> </ul> </section> <section class="tsd-index-section "> <h3>Type aliases</h3> <ul class="tsd-index-list"> <li class="tsd-kind-type-alias tsd-parent-kind-external-module"><a href="_node_modules__modelx_data_src_util_.html#inputcomponents" class="tsd-kind-icon">Input<wbr>Components</a></li> <li class="tsd-kind-type-alias tsd-parent-kind-external-module"><a href="_node_modules__modelx_data_src_util_.html#scaledtransforms" class="tsd-kind-icon">Scaled<wbr>Transforms</a></li> </ul> </section> <section class="tsd-index-section tsd-is-not-exported"> <h3>Variables</h3> <ul class="tsd-index-list"> <li class="tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#avg" class="tsd-kind-icon">avg</a></li> <li class="tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#max" class="tsd-kind-icon">max</a></li> <li class="tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#mean" class="tsd-kind-icon">mean</a></li> <li class="tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#min" class="tsd-kind-icon">min</a></li> <li class="tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#sd" class="tsd-kind-icon">sd</a></li> <li class="tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#sum" class="tsd-kind-icon">sum</a></li> </ul> </section> <section class="tsd-index-section tsd-is-not-exported"> <h3>Functions</h3> <ul class="tsd-index-list"> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#madmeanratio" class="tsd-kind-icon">MADMean<wbr>Ratio</a></li> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#minmaxscaler" class="tsd-kind-icon">Min<wbr>Max<wbr>Scaler</a></li> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#minmaxscalertransforms" class="tsd-kind-icon">Min<wbr>Max<wbr>Scaler<wbr>Transforms</a></li> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#standardscaler" class="tsd-kind-icon">Standard<wbr>Scaler</a></li> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#standardscalertransforms" class="tsd-kind-icon">Standard<wbr>Scaler<wbr>Transforms</a></li> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#adjustedcoefficentofdetermination" class="tsd-kind-icon">adjusted<wbr>Coefficent<wbr>OfDetermination</a></li> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#approximatezpercentile" class="tsd-kind-icon">approximateZPercentile</a></li> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#coefficientofcorrelation" class="tsd-kind-icon">coefficient<wbr>OfCorrelation</a></li> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#coefficientofdetermination" class="tsd-kind-icon">coefficient<wbr>OfDetermination</a></li> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#forecasterrors" class="tsd-kind-icon">forecast<wbr>Errors</a></li> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#getsafepropertyname" class="tsd-kind-icon">get<wbr>Safe<wbr>Property<wbr>Name</a></li> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#meanabsolutedeviation" class="tsd-kind-icon">mean<wbr>Absolute<wbr>Deviation</a></li> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#meanabsolutepercentageerror" class="tsd-kind-icon">mean<wbr>Absolute<wbr>Percentage<wbr>Error</a></li> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#meanforecasterror" class="tsd-kind-icon">mean<wbr>Forecast<wbr>Error</a></li> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#meansquarederror" class="tsd-kind-icon">mean<wbr>Squared<wbr>Error</a></li> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#pivotarrays" class="tsd-kind-icon">pivot<wbr>Arrays</a></li> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#pivotvector" class="tsd-kind-icon">pivot<wbr>Vector</a></li> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#rsquared" class="tsd-kind-icon">r<wbr>Squared</a></li> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#scale-1" class="tsd-kind-icon">scale</a></li> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#squareddifference" class="tsd-kind-icon">squared<wbr>Difference</a></li> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#standarderror" class="tsd-kind-icon">standard<wbr>Error</a></li> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#standardscore" class="tsd-kind-icon">standard<wbr>Score</a></li> <li class="tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"><a href="_node_modules__modelx_data_src_util_.html#trackingsignal" class="tsd-kind-icon">tracking<wbr>Signal</a></li> </ul> </section> <section class="tsd-index-section "> <h3>Object literals</h3> <ul class="tsd-index-list"> <li class="tsd-kind-object-literal tsd-parent-kind-external-module"><a href="_node_modules__modelx_data_src_util_.html#util" class="tsd-kind-icon">util</a></li> </ul> </section> </div> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Type aliases</h2> <section class="tsd-panel tsd-member tsd-kind-type-alias tsd-parent-kind-external-module"> <a name="inputcomponents" class="tsd-anchor"></a> <h3>Input<wbr>Components</h3> <div class="tsd-signature tsd-kind-icon">Input<wbr>Components<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>average<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>maximum<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>minimum<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>standard_dev<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span></div> <aside class="tsd-sources"> <ul> <li>Defined in Users/yawjosephetse/Developer/github/repetere/modelx/node_modules/@modelx/data/src/util.ts:260</li> </ul> </aside> <div class="tsd-type-declaration"> <h4>Type declaration</h4> <ul class="tsd-parameters"> <li class="tsd-parameter"> <h5><span class="tsd-flag ts-flagOptional">Optional</span> average<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span></h5> </li> <li class="tsd-parameter"> <h5><span class="tsd-flag ts-flagOptional">Optional</span> maximum<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span></h5> </li> <li class="tsd-parameter"> <h5><span class="tsd-flag ts-flagOptional">Optional</span> minimum<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span></h5> </li> <li class="tsd-parameter"> <h5><span class="tsd-flag ts-flagOptional">Optional</span> standard_<wbr>dev<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span></h5> </li> </ul> </div> </section> <section class="tsd-panel tsd-member tsd-kind-type-alias tsd-parent-kind-external-module"> <a name="scaledtransforms" class="tsd-anchor"></a> <h3>Scaled<wbr>Transforms</h3> <div class="tsd-signature tsd-kind-icon">Scaled<wbr>Transforms<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>components<span class="tsd-signature-symbol">: </span><a href="_node_modules__modelx_data_src_util_.html#inputcomponents" class="tsd-signature-type">InputComponents</a><span class="tsd-signature-symbol">; </span>descale<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>x<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>scale<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>x<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>values<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> }</span></div> <aside class="tsd-sources"> <ul> <li>Defined in Users/yawjosephetse/Developer/github/repetere/modelx/node_modules/@modelx/data/src/util.ts:267</li> </ul> </aside> <div class="tsd-type-declaration"> <h4>Type declaration</h4> <ul class="tsd-parameters"> <li class="tsd-parameter"> <h5>components<span class="tsd-signature-symbol">: </span><a href="_node_modules__modelx_data_src_util_.html#inputcomponents" class="tsd-signature-type">InputComponents</a></h5> </li> <li class="tsd-parameter"> <h5>descale<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>x<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">number</span></h5> <ul class="tsd-parameters"> <li class="tsd-parameter-siganture"> <ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-variable"> <li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>x<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>x: <span class="tsd-signature-type">number</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> </li> </ul> </li> </ul> </li> <li class="tsd-parameter"> <h5>scale<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>x<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">number</span></h5> <ul class="tsd-parameters"> <li class="tsd-parameter-siganture"> <ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-variable"> <li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>x<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>x: <span class="tsd-signature-type">number</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> </li> </ul> </li> </ul> </li> <li class="tsd-parameter"> <h5>values<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h5> </li> </ul> </div> </section> </section> <section class="tsd-panel-group tsd-member-group tsd-is-not-exported"> <h2>Variables</h2> <section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported"> <a name="avg" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagConst">Const</span> avg</h3> <div class="tsd-signature tsd-kind-icon">avg<span class="tsd-signature-symbol">:</span> <a href="../interfaces/_node_modules__modelx_data_src_util_.arraycalculation.html" class="tsd-signature-type">ArrayCalculation</a><span class="tsd-signature-symbol"> = ArrayStat.mean</span></div> <aside class="tsd-sources"> <ul> <li>Defined in Users/yawjosephetse/Developer/github/repetere/modelx/node_modules/@modelx/data/src/util.ts:12</li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported"> <a name="max" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagConst">Const</span> max</h3> <div class="tsd-signature tsd-kind-icon">max<span class="tsd-signature-symbol">:</span> <a href="../interfaces/_node_modules__modelx_data_src_util_.arraysort.html" class="tsd-signature-type">ArraySort</a><span class="tsd-signature-symbol"> = ArrayStat.max</span></div> <aside class="tsd-sources"> <ul> <li>Defined in Users/yawjosephetse/Developer/github/repetere/modelx/node_modules/@modelx/data/src/util.ts:16</li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported"> <a name="mean" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagConst">Const</span> mean</h3> <div class="tsd-signature tsd-kind-icon">mean<span class="tsd-signature-symbol">:</span> <a href="../interfaces/_node_modules__modelx_data_src_util_.arraycalculation.html" class="tsd-signature-type">ArrayCalculation</a><span class="tsd-signature-symbol"> = avg</span></div> <aside class="tsd-sources"> <ul> <li>Defined in Users/yawjosephetse/Developer/github/repetere/modelx/node_modules/@modelx/data/src/util.ts:13</li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported"> <a name="min" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagConst">Const</span> min</h3> <div class="tsd-signature tsd-kind-icon">min<span class="tsd-signature-symbol">:</span> <a href="../interfaces/_node_modules__modelx_data_src_util_.arraysort.html" class="tsd-signature-type">ArraySort</a><span class="tsd-signature-symbol"> = ArrayStat.min</span></div> <aside class="tsd-sources"> <ul> <li>Defined in Users/yawjosephetse/Developer/github/repetere/modelx/node_modules/@modelx/data/src/util.ts:17</li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported"> <a name="sd" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagConst">Const</span> sd</h3> <div class="tsd-signature tsd-kind-icon">sd<span class="tsd-signature-symbol">:</span> <a href="../interfaces/_node_modules__modelx_data_src_util_.arraycalculation.html" class="tsd-signature-type">ArrayCalculation</a><span class="tsd-signature-symbol"> = ArrayStat.standardDeviation</span></div> <aside class="tsd-sources"> <ul> <li>Defined in Users/yawjosephetse/Developer/github/repetere/modelx/node_modules/@modelx/data/src/util.ts:18</li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported"> <a name="sum" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagConst">Const</span> sum</h3> <div class="tsd-signature tsd-kind-icon">sum<span class="tsd-signature-symbol">:</span> <a href="../interfaces/_node_modules__modelx_data_src_util_.arraycalculation.html" class="tsd-signature-type">ArrayCalculation</a><span class="tsd-signature-symbol"> = ArrayStat.sum</span></div> <aside class="tsd-sources"> <ul> <li>Defined in Users/yawjosephetse/Developer/github/repetere/modelx/node_modules/@modelx/data/src/util.ts:14</li> </ul> </aside> </section> </section> <section class="tsd-panel-group tsd-member-group tsd-is-not-exported"> <h2>Functions</h2> <section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"> <a name="madmeanratio" class="tsd-anchor"></a> <h3>MADMean<wbr>Ratio</h3> <ul class="tsd-signatures tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"> <li class="tsd-signature tsd-kind-icon">MADMean<wbr>Ratio<span class="tsd-signature-symbol">(</span>actuals<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span>, estimates<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in Users/yawjosephetse/Developer/github/repetere/modelx/node_modules/@modelx/data/src/util.ts:523</li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>MAD over Mean Ratio - The MAD/Mean ratio is an alternative to the MAPE that is better suited to intermittent and low-volume data. As stated previously, percentage errors cannot be calculated when the actual equals zero and can take on extreme values when dealing with low-volume data. These issues become magnified when you start to average MAPEs over multiple time series. The MAD/Mean ratio tries to overcome this problem by dividing the MAD by the Mean—essentially rescaling the error to make it comparable across time series of varying scales</p> </div> <dl class="tsd-comment-tags"> <dt>memberof</dt> <dd><p>util</p> </dd> <dt>see</dt> <dd><p><a href="https://www.forecastpro.com/Trends/forecasting101August2011.html" class="external">https://www.forecastpro.com/Trends/forecasting101August2011.html</a></p> </dd> <dt>example</dt> <dd><p>const actuals = [ 45, 38, 43, 39 ]; const estimates = [ 41, 43, 41, 42 ]; const MMR = ms.util.MADMeanRatio(actuals, estimates); MAPE.toFixed(2) // =&gt; 0.08</p> </dd> </dl> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>actuals: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h5> <div class="tsd-comment tsd-typography"> <p>numerical samples</p> </div> </li> <li> <h5>estimates: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h5> <div class="tsd-comment tsd-typography"> <p>estimates values</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> <p>MMR</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"> <a name="minmaxscaler" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagConst">Const</span> Min<wbr>Max<wbr>Scaler</h3> <ul class="tsd-signatures tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"> <li class="tsd-signature tsd-kind-icon">Min<wbr>Max<wbr>Scaler<span class="tsd-signature-symbol">(</span>z<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in Users/yawjosephetse/Developer/github/repetere/modelx/node_modules/@modelx/data/src/util.ts:328</li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Transforms features by scaling each feature to a given range. This estimator scales and translates each feature individually such that it is in the given range on the training set, i.e. between zero and one.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>z: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h5> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>array of integers or floats</p> </div> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"> <a name="minmaxscalertransforms" class="tsd-anchor"></a> <h3>Min<wbr>Max<wbr>Scaler<wbr>Transforms</h3> <ul class="tsd-signatures tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"> <li class="tsd-signature tsd-kind-icon">Min<wbr>Max<wbr>Scaler<wbr>Transforms<span class="tsd-signature-symbol">(</span>vector<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span>, nan_value<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, return_nan<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span>, inputComponents<span class="tsd-signature-symbol">?: </span><a href="_node_modules__modelx_data_src_util_.html#inputcomponents" class="tsd-signature-type">InputComponents</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_node_modules__modelx_data_src_util_.html#scaledtransforms" class="tsd-signature-type">ScaledTransforms</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in Users/yawjosephetse/Developer/github/repetere/modelx/node_modules/@modelx/data/src/util.ts:334</li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>This function returns two functions that can mix max scale new inputs and reverse scale new outputs</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5><span class="tsd-flag ts-flagDefault value">Default value</span> vector: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = []</span></h5> </li> <li> <h5><span class="tsd-flag ts-flagDefault value">Default value</span> nan_value: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = -1</span></h5> </li> <li> <h5><span class="tsd-flag ts-flagDefault value">Default value</span> return_nan: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></h5> </li> <li> <h5><span class="tsd-flag ts-flagDefault value">Default value</span> inputComponents: <a href="_node_modules__modelx_data_src_util_.html#inputcomponents" class="tsd-signature-type">InputComponents</a><span class="tsd-signature-symbol"> = {}</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <a href="_node_modules__modelx_data_src_util_.html#scaledtransforms" class="tsd-signature-type">ScaledTransforms</a></h4> <ul> <li>{scale[ Function ], descale[ Function ]}</li> </ul> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"> <a name="standardscaler" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagConst">Const</span> Standard<wbr>Scaler</h3> <ul class="tsd-signatures tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"> <li class="tsd-signature tsd-kind-icon">Standard<wbr>Scaler<span class="tsd-signature-symbol">(</span>z<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in Users/yawjosephetse/Developer/github/repetere/modelx/node_modules/@modelx/data/src/util.ts:258</li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Standardize features by removing the mean and scaling to unit variance</p> </div> <p>Centering and scaling happen independently on each feature by computing the relevant statistics on the samples in the training set. Mean and standard deviation are then stored to be used on later data using the transform method.</p> <p>Standardization of a dataset is a common requirement for many machine learning estimators: they might behave badly if the individual feature do not more or less look like standard normally distributed data (e.g. Gaussian with 0 mean and unit variance)</p> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>z: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h5> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>array of integers or floats</p> </div> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"> <a name="standardscalertransforms" class="tsd-anchor"></a> <h3>Standard<wbr>Scaler<wbr>Transforms</h3> <ul class="tsd-signatures tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"> <li class="tsd-signature tsd-kind-icon">Standard<wbr>Scaler<wbr>Transforms<span class="tsd-signature-symbol">(</span>vector<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span>, nan_value<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, return_nan<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span>, inputComponents<span class="tsd-signature-symbol">?: </span><a href="_node_modules__modelx_data_src_util_.html#inputcomponents" class="tsd-signature-type">InputComponents</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_node_modules__modelx_data_src_util_.html#scaledtransforms" class="tsd-signature-type">ScaledTransforms</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in Users/yawjosephetse/Developer/github/repetere/modelx/node_modules/@modelx/data/src/util.ts:278</li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>This function returns two functions that can standard scale new inputs and reverse scale new outputs</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5><span class="tsd-flag ts-flagDefault value">Default value</span> vector: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = []</span></h5> </li> <li> <h5><span class="tsd-flag ts-flagDefault value">Default value</span> nan_value: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = -1</span></h5> </li> <li> <h5><span class="tsd-flag ts-flagDefault value">Default value</span> return_nan: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></h5> </li> <li> <h5><span class="tsd-flag ts-flagDefault value">Default value</span> inputComponents: <a href="_node_modules__modelx_data_src_util_.html#inputcomponents" class="tsd-signature-type">InputComponents</a><span class="tsd-signature-symbol"> = {}</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <a href="_node_modules__modelx_data_src_util_.html#scaledtransforms" class="tsd-signature-type">ScaledTransforms</a></h4> <ul> <li>{scale[ Function ], descale[ Function ]}</li> </ul> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"> <a name="adjustedcoefficentofdetermination" class="tsd-anchor"></a> <h3>adjusted<wbr>Coefficent<wbr>OfDetermination</h3> <ul class="tsd-signatures tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"> <li class="tsd-signature tsd-kind-icon">adjusted<wbr>Coefficent<wbr>OfDetermination<span class="tsd-signature-symbol">(</span>options<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>actuals<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">; </span>estimates<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">; </span>independentVariables<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>rSquared<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>sampleSize<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in Users/yawjosephetse/Developer/github/repetere/modelx/node_modules/@modelx/data/src/util.ts:136</li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>You can use the adjusted coefficient of determination to determine how well a multiple regression equation “fits” the sample data. The adjusted coefficient of determination is closely related to the coefficient of determination (also known as R2) that you use to test the results of a simple regression equation.</p> </div> <dl class="tsd-comment-tags"> <dt>example</dt> <dd><p>const adjr2 = ms.util.adjustedCoefficentOfDetermination({ rSquared: 0.944346527, sampleSize: 8, independentVariables: 2, }); r2.toFixed(3) // =&gt; 0.922</p> </dd> <dt>memberof</dt> <dd><p>util</p> </dd> <dt>see</dt> <dd><p><a href="http://www.dummies.com/education/math/business-statistics/how-to-calculate-the-adjusted-coefficient-of-determination/" class="external">http://www.dummies.com/education/math/business-statistics/how-to-calculate-the-adjusted-coefficient-of-determination/</a></p> </dd> </dl> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>options: <span class="tsd-signature-symbol">{ </span>actuals<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">; </span>estimates<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">; </span>independentVariables<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>rSquared<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>sampleSize<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span></h5> <ul class="tsd-parameters"> <li class="tsd-parameter"> <h5>actuals<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h5> </li> <li class="tsd-parameter"> <h5>estimates<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h5> </li> <li class="tsd-parameter"> <h5>independent<wbr>Variables<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5> <div class="tsd-comment tsd-typography"> <p>the number of independent variables in the regression equation</p> </div> </li> <li class="tsd-parameter"> <h5>r<wbr>Squared<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5> </li> <li class="tsd-parameter"> <h5>sample<wbr>Size<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5> </li> </ul> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> <p>adjusted r^2 for multiple linear regression</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"> <a name="approximatezpercentile" class="tsd-anchor"></a> <h3>approximateZPercentile</h3> <ul class="tsd-signatures tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"> <li class="tsd-signature tsd-kind-icon">approximateZPercentile<span class="tsd-signature-symbol">(</span>z<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, alpha<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in Users/yawjosephetse/Developer/github/repetere/modelx/node_modules/@modelx/data/src/util.ts:386</li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Converts z-score into the probability</p> </div> <dl class="tsd-comment-tags"> <dt>memberof</dt> <dd><p>util</p> </dd> <dt>see</dt> <dd><p><a href="https://stackoverflow.com/questions/36575743/how-do-i-convert-probability-into-z-score" class="external">https://stackoverflow.com/questions/36575743/how-do-i-convert-probability-into-z-score</a></p> </dd> </dl> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>z: <span class="tsd-signature-type">number</span></h5> <div class="tsd-comment tsd-typography"> <p>Number of standard deviations from the mean.</p> </div> </li> <li> <h5><span class="tsd-flag ts-flagDefault value">Default value</span> alpha: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> <p>p - p-value</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"> <a name="coefficientofcorrelation" class="tsd-anchor"></a> <h3>coefficient<wbr>OfCorrelation</h3> <ul class="tsd-signatures tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"> <li class="tsd-signature tsd-kind-icon">coefficient<wbr>OfCorrelation<span class="tsd-signature-symbol">(</span>actuals<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span>, estimates<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in Users/yawjosephetse/Developer/github/repetere/modelx/node_modules/@modelx/data/src/util.ts:160</li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>The coefficent of Correlation is given by R decides how well the given data fits a line or a curve.</p> </div> <dl class="tsd-comment-tags"> <dt>example</dt> <dd><p>const actuals = [ 39, 42, 67, 76, ]; const estimates = [ 44, 40, 60, 84, ]; const R = ms.util.coefficientOfCorrelation(actuals, estimates); R.toFixed(4) // =&gt; 0.9408</p> </dd> <dt>memberof</dt> <dd><p>util</p> </dd> <dt>see</dt> <dd><p><a href="https://calculator.tutorvista.com/r-squared-calculator.html" class="external">https://calculator.tutorvista.com/r-squared-calculator.html</a></p> </dd> </dl> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5><span class="tsd-flag ts-flagDefault value">Default value</span> actuals: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = []</span></h5> <div class="tsd-comment tsd-typography"> <p>numerical samples</p> </div> </li> <li> <h5><span class="tsd-flag ts-flagDefault value">Default value</span> estimates: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = []</span></h5> <div class="tsd-comment tsd-typography"> <p>estimates values</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> <p>R</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"> <a name="coefficientofdetermination" class="tsd-anchor"></a> <h3>coefficient<wbr>OfDetermination</h3> <ul class="tsd-signatures tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"> <li class="tsd-signature tsd-kind-icon">coefficient<wbr>OfDetermination<span class="tsd-signature-symbol">(</span>actuals<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span>, estimates<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in Users/yawjosephetse/Developer/github/repetere/modelx/node_modules/@modelx/data/src/util.ts:81</li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>In statistics, the coefficient of determination, denoted R2 or r2 and pronounced &quot;R squared&quot;, is the proportion of the variance in the dependent variable that is predictable from the independent variable(s). Compares distance of estimated values to the mean. {\bar {y}}={\frac {1}{n}}\sum <em>{i=1}^{n}y</em>{i}</p> </div> <dl class="tsd-comment-tags"> <dt>example</dt> <dd><p>const actuals = [ 2, 4, 5, 4, 5, ]; const estimates = [ 2.8, 3.4, 4, 4.6, 5.2, ]; const r2 = ms.util.coefficientOfDetermination(actuals, estimates); r2.toFixed(1) // =&gt; 0.6</p> </dd> <dt>memberof</dt> <dd><p>util</p> </dd> <dt>see</dt> <dd><p><a href="https://en.wikipedia.org/wiki/Coefficient_of_determination" class="external">https://en.wikipedia.org/wiki/Coefficient_of_determination</a> <a href="http://statisticsbyjim.com/regression/standard-error-regression-vs-r-squared/" class="external">http://statisticsbyjim.com/regression/standard-error-regression-vs-r-squared/</a></p> </dd> </dl> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5><span class="tsd-flag ts-flagDefault value">Default value</span> actuals: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = []</span></h5> <div class="tsd-comment tsd-typography"> <p>numerical samples</p> </div> </li> <li> <h5><span class="tsd-flag ts-flagDefault value">Default value</span> estimates: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = []</span></h5> <div class="tsd-comment tsd-typography"> <p>estimates values</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> <p>r^2</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported"> <a name="forecasterrors" class="tsd-anchor"></a> <h3>forecast<wbr>Errors</h3> <ul class="tsd-signatures tsd-kind-function tsd-parent-kind-external-module tsd-i