Skip to content

Commit d9b9d6a

Browse files
committed
separate models and helpers in two separate modules (and add some documentation on job helper)
1 parent 95d5aca commit d9b9d6a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1047
-900
lines changed

dist/predicsis-jsSDK.js

Lines changed: 355 additions & 302 deletions
Large diffs are not rendered by default.

dist/predicsis-jsSDK.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/predicsis-jsSDK.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/js/docs-setup.js

Lines changed: 83 additions & 75 deletions
Large diffs are not rendered by default.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/edit/master/lib/helper/jobsHelper.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/95d5aca/lib/helper/jobsHelper.js#L25" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">jobsHelper</code>
2+
<div><span class="hint">service in module <code ng:non-bindable="">predicsis.jsSDK.helpers</code>
3+
</span>
4+
</div>
5+
</h1>
6+
<div><div class="member method"><h2 id="methods">Methods</h2>
7+
<ul class="methods"><li><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/95d5aca/lib/helper/jobsHelper.js#L47" class="view-source icon-eye-open"> </a><h3 id="methods_listen">listen(jobId)</h3>
8+
<div class="listen"><div class="listen-page"><p>Active pulling on a job waiting for its termination</p>
9+
<p><b>Important notes:</b></p>
10+
<ul>
11+
<li>You can <em>listen</em>only one job at a time</li>
12+
<li>a <kbd>GET /jobs/:jobId</kbd> is going to be sent every 3 second the first minute, and every minute after</li>
13+
</ul></div><h5 id="methods_listen_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>jobId</td><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="listen-page"><p>The id of the job api resource you want to wait termination</p>
14+
</div></td></tr></tbody></table><h5 id="methods_listen_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-promise">Promise</a></td><td><div class="listen-page"><p>A promise resolved only when the job succeeds</p>
15+
</div></td></tr></table></div>
16+
</li>
17+
<li><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/95d5aca/lib/helper/jobsHelper.js#L120" class="view-source icon-eye-open"> </a><h3 id="methods_wrapasyncpromise">wrapAsyncPromise(promise)</h3>
18+
<div class="wrapasyncpromise"><div class="wrapasyncpromise-page"><p>Transform an async promise into the same promise resolving only when job is completed</p>
19+
<p>Usage example:
20+
<pre class="prettyprint linenums">
21+
return jobsHelper
22+
.wrapAsyncPromise(datasets().post({dataset: params}))
23+
.then(function(dataset) {
24+
// do something with you completely created new dataset
25+
// ...
26+
});
27+
</pre>
28+
</div><h5 id="methods_wrapasyncpromise_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>promise</td><td><a href="" class="label type-hint type-hint-promise">Promise</a><a href="" class="label type-hint type-hint-array">Array</a></td><td><div class="wrapasyncpromise-page"><p>or list of jobs (the last one will be listened)</p>
29+
</div></td></tr></tbody></table><h5 id="methods_wrapasyncpromise_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-promise">Promise</a></td><td><div class="wrapasyncpromise-page"><p>See above example</p>
30+
</div></td></tr></table></div>
31+
</li>
32+
</ul>
33+
</div>
34+
</div>

docs/partials/api/predicsis.jsSDK.modelHelper.html renamed to docs/partials/api/predicsis.jsSDK.helpers.modelHelper.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
<a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/edit/master/lib/helper/modelHelper.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/ce774c5/lib/helper/modelHelper.js#L13" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">modelHelper</code>
2-
<div><span class="hint">service in module <code ng:non-bindable="">predicsis.jsSDK</code>
1+
<a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/edit/master/lib/helper/modelHelper.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/95d5aca/lib/helper/modelHelper.js#L13" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">modelHelper</code>
2+
<div><span class="hint">service in module <code ng:non-bindable="">predicsis.jsSDK.helpers</code>
33
</span>
44
</div>
55
</h1>
66
<div><h2 id="dependencies">Dependencies</h2>
77
<ul class="dependencies"><li><code ng:non-bindable=""><a href="#/api/ng.$injector">$injector</a></code>
8-
<div class="predicsis-jssdk-modelhelper-page"><ul>
9-
<li><a href="#/api/predicsis.jsSDK.Datasets">Datasets</a></li>
10-
<li><a href="#/api/predicsis.jsSDK.Models">Models</a></li>
11-
<li><a href="#/api/predicsis.jsSDK.Reports">Reports</a></li>
12-
<li><a href="#/api/predicsis.jsSDK.Projects">Projects</a></li>
13-
<li><a href="#/api/predicsis.jsSDK.PreparationRules">PreparationRules</a></li>
8+
<div class="predicsis-jssdk-helpers-modelhelper-page"><ul>
9+
<li><a href="#/api/predicsis.jsSDK.models.Datasets">Datasets</a></li>
10+
<li><a href="#/api/predicsis.jsSDK.models.Models">Models</a></li>
11+
<li><a href="#/api/predicsis.jsSDK.models.Reports">Reports</a></li>
12+
<li><a href="#/api/predicsis.jsSDK.models.Projects">Projects</a></li>
13+
<li><a href="#/api/predicsis.jsSDK.models.PreparationRules">PreparationRules</a></li>
1414
<li>$q</li>
1515
<li>$rootScope</li>
1616
</ul>
1717
</div></li>
1818
</ul>
1919
<div class="member method"><h2 id="methods">Methods</h2>
20-
<ul class="methods"><li><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/ce774c5/lib/helper/modelHelper.js#L61" class="view-source icon-eye-open"> </a><h3 id="methods_learn">learn(project)</h3>
20+
<ul class="methods"><li><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/95d5aca/lib/helper/modelHelper.js#L62" class="view-source icon-eye-open"> </a><h3 id="methods_learn">learn(project)</h3>
2121
<div class="learn"><div class="learn-page"><p>Learn a model</p>
2222
<p>This function wraps the following requests:</p>
2323
<ul>
@@ -36,7 +36,7 @@
3636
<p>To do so, what we really use are the following parameters:</p>
3737
<ul>
3838
<li><kbd>project.learning_dataset_id</kbd> to find the training partition of the input dataset</li>
39-
<li><kbd>project.target_variable_id</kbd> to create a valid <a href="#/api/predicsis.jsSDK.PreparationRules">PreparationRules</a></li>
39+
<li><kbd>project.target_variable_id</kbd> to create a valid <a href="#/api/predicsis.jsSDK.models.PreparationRules">PreparationRules</a></li>
4040
<li><kbd>project.id</kbd> to store preparation rules set, classifier and reports ids.</li>
4141
</ul>
4242

@@ -50,8 +50,8 @@
5050
<li>jsSDK.learn.start-learning</li>
5151
<li>jsSDK.learn.start-generating-reports</li>
5252
<li>jsSDK.learn.start-updating-project</li>
53-
</ul></div><h5 id="methods_learn_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>project</td><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="learn-page"><p>Instance of a valid <a href="#/api/predicsis.jsSDK.Projects">Project</a></p>
54-
</div></td></tr></tbody></table><h5 id="methods_learn_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="learn-page"><p>Instance of a complete <a href="#/api/predicsis.jsSDK.Models">Models</a></p>
53+
</ul></div><h5 id="methods_learn_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>project</td><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="learn-page"><p>Instance of a valid <a href="#/api/predicsis.jsSDK.models.Projects">Project</a></p>
54+
</div></td></tr></tbody></table><h5 id="methods_learn_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="learn-page"><p>Instance of a complete <a href="#/api/predicsis.jsSDK.models.Models">Models</a></p>
5555
</div></td></tr></table></div>
5656
</li>
5757
</ul>

docs/partials/api/predicsis.jsSDK.projectsHelper.html renamed to docs/partials/api/predicsis.jsSDK.helpers.projectsHelper.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
1-
<a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/edit/master/lib/helper/projectsHelper.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/ce774c5/lib/helper/projectsHelper.js#L6" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">projectsHelper</code>
2-
<div><span class="hint">service in module <code ng:non-bindable="">predicsis.jsSDK</code>
1+
<a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/edit/master/lib/helper/projectsHelper.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/95d5aca/lib/helper/projectsHelper.js#L6" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">projectsHelper</code>
2+
<div><span class="hint">service in module <code ng:non-bindable="">predicsis.jsSDK.helpers</code>
33
</span>
44
</div>
55
</h1>
66
<div><div class="member method"><h2 id="methods">Methods</h2>
7-
<ul class="methods"><li><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/ce774c5/lib/helper/projectsHelper.js#L61" class="view-source icon-eye-open"> </a><h3 id="methods_addlearningdataset">addLearningDataset(project, datasetId)</h3>
7+
<ul class="methods"><li><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/95d5aca/lib/helper/projectsHelper.js#L62" class="view-source icon-eye-open"> </a><h3 id="methods_addlearningdataset">addLearningDataset(project, datasetId)</h3>
88
<div class="addlearningdataset"><div class="addlearningdataset-page"><p>Simply adds an entry to <code>learning_dataset_id</code> project&#39;s property.</p>
99
<p><span class="badge patch">patch</span><code>/projects/:projectId</code></p>
1010
</div><h5 id="methods_addlearningdataset_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>project</td><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="addlearningdataset-page"><p><a href="#/api/API.model.Projects">Projects model</a></p>
1111
</div></td></tr><tr><td>datasetId</td><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="addlearningdataset-page"><p>Id of the dataset which will be used for learning</p>
1212
</div></td></tr></tbody></table><h5 id="methods_addlearningdataset_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="addlearningdataset-page"><p>Promise of an updated project</p>
1313
</div></td></tr></table></div>
1414
</li>
15-
<li><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/ce774c5/lib/helper/projectsHelper.js#L96" class="view-source icon-eye-open"> </a><h3 id="methods_addscoreset">addScoreset(project, datasetId)</h3>
15+
<li><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/95d5aca/lib/helper/projectsHelper.js#L97" class="view-source icon-eye-open"> </a><h3 id="methods_addscoreset">addScoreset(project, datasetId)</h3>
1616
<div class="addscoreset"><div class="addscoreset-page"><p>Simply adds an entry to <code>scoreset_ids</code> project&#39;s array.</p>
1717
<p><span class="badge patch">patch</span><code>/projects/:projectId</code></p>
1818
</div><h5 id="methods_addscoreset_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>project</td><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="addscoreset-page"><p><a href="#/api/API.model.Projects">Projects model</a></p>
1919
</div></td></tr><tr><td>datasetId</td><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="addscoreset-page"><p>Id of the dataset which will store score results</p>
2020
</div></td></tr></tbody></table><h5 id="methods_addscoreset_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="addscoreset-page"><p>Promise of an updated project</p>
2121
</div></td></tr></table></div>
2222
</li>
23-
<li><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/ce774c5/lib/helper/projectsHelper.js#L77" class="view-source icon-eye-open"> </a><h3 id="methods_addscoringdataset">addScoringDataset(project, datasetId)</h3>
23+
<li><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/95d5aca/lib/helper/projectsHelper.js#L78" class="view-source icon-eye-open"> </a><h3 id="methods_addscoringdataset">addScoringDataset(project, datasetId)</h3>
2424
<div class="addscoringdataset"><div class="addscoringdataset-page"><p>Simply adds an entry to <code>scoring_dataset_ids</code> project&#39;s array.</p>
2525
<p><span class="badge patch">patch</span><code>/projects/:projectId</code></p>
2626
</div><h5 id="methods_addscoringdataset_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>project</td><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="addscoringdataset-page"><p><a href="#/api/API.model.Projects">Projects model</a></p>
2727
</div></td></tr><tr><td>datasetId</td><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="addscoringdataset-page"><p>Id of the dataset which will be used for score</p>
2828
</div></td></tr></tbody></table><h5 id="methods_addscoringdataset_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="addscoringdataset-page"><p>Promise of an updated project</p>
2929
</div></td></tr></table></div>
3030
</li>
31-
<li><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/ce774c5/lib/helper/projectsHelper.js#L43" class="view-source icon-eye-open"> </a><h3 id="methods_isdictionaryverified">isDictionaryVerified(project)</h3>
31+
<li><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/95d5aca/lib/helper/projectsHelper.js#L44" class="view-source icon-eye-open"> </a><h3 id="methods_isdictionaryverified">isDictionaryVerified(project)</h3>
3232
<div class="isdictionaryverified"><div class="isdictionaryverified-page"><p>Tells if the user checked its project&#39;s dictionary.</p>
3333
<p> A dictionary contains a description of each variable used (or unused) of the model. That&#39;s why scenario forces
3434
the user to check generated dictionaries.</p>
3535
</div><h5 id="methods_isdictionaryverified_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>project</td><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="isdictionaryverified-page"><p><a href="#/api/API.model.Projects">Projects model</a></p>
3636
</div></td></tr></tbody></table><h5 id="methods_isdictionaryverified_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-boolean">boolean</a></td><td><div class="isdictionaryverified-page"><p><code>true</code> / <code>false</code></p>
3737
</div></td></tr></table></div>
3838
</li>
39-
<li><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/ce774c5/lib/helper/projectsHelper.js#L27" class="view-source icon-eye-open"> </a><h3 id="methods_ismodeldone">isModelDone(project)</h3>
39+
<li><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/95d5aca/lib/helper/projectsHelper.js#L28" class="view-source icon-eye-open"> </a><h3 id="methods_ismodeldone">isModelDone(project)</h3>
4040
<div class="ismodeldone"><div class="ismodeldone-page"><p>Tells if there is a model for the given project.</p>
4141
<p> <b>Note:</b> A project can have only one Model. It means that you can go back to the first steps of the scenario
4242
if your current project already has a model attached. If you want to change a parameter, you have to create a new
@@ -45,15 +45,15 @@
4545
</div></td></tr></tbody></table><h5 id="methods_ismodeldone_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-boolean">boolean</a></td><td><div class="ismodeldone-page"><p><code>true</code> / <code>false</code></p>
4646
</div></td></tr></table></div>
4747
</li>
48-
<li><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/ce774c5/lib/helper/projectsHelper.js#L143" class="view-source icon-eye-open"> </a><h3 id="methods_removedependencies">removeDependencies(projectId)</h3>
48+
<li><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/95d5aca/lib/helper/projectsHelper.js#L144" class="view-source icon-eye-open"> </a><h3 id="methods_removedependencies">removeDependencies(projectId)</h3>
4949
<div class="removedependencies"><div class="removedependencies-page"><p>Removes linked resources prior to being able to remove the project</p>
5050
<div><span class="badge get">get</span><code>/projects/:projectId</code></div>
5151
<div><span class="badge delete">delete</span><code>/dictionaries/:project.dictionary_id</code></div>
5252
<div><span class="badge delete">delete</span><code>/model/:project.classifier_id</code></div></div><h5 id="methods_removedependencies_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>projectId</td><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="removedependencies-page"><p>Id of the project you want to update</p>
5353
</div></td></tr></tbody></table><h5 id="methods_removedependencies_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="removedependencies-page"><p>Promise of an updated project</p>
5454
</div></td></tr></table></div>
5555
</li>
56-
<li><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/ce774c5/lib/helper/projectsHelper.js#L121" class="view-source icon-eye-open"> </a><h3 id="methods_resetdictionary">resetDictionary(projectId)</h3>
56+
<li><a href="https://github.com/yllieth/predicsis_ml_sdk-javascript/blob/95d5aca/lib/helper/projectsHelper.js#L122" class="view-source icon-eye-open"> </a><h3 id="methods_resetdictionary">resetDictionary(projectId)</h3>
5757
<div class="resetdictionary"><div class="resetdictionary-page"><p>Simply set to <code>null</code> the following project&#39;s properties:</p>
5858
<ul>
5959
<li><code>dictionary_id</code></li>

0 commit comments

Comments
 (0)