Skip to content

Commit 599213c

Browse files
committed
Return named subsets when calling split() method
1 parent 9f65ac5 commit 599213c

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

dist/predicsis-jsSDK.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,14 +513,18 @@ angular
513513
* <li><code>30%</code> of your original dataset for <b>testing</b></li>
514514
* </ul><br/>
515515
* @return {Promise} Subsets
516+
* {
517+
* train: {id: "..."},
518+
* test: {id: "..."}
519+
* }
516520
*/
517521
this.split = function(id, name, filename, sampling) {
518522
filename = filename || name;
519523
sampling = sampling || DEFAULT_SAMPLING;
520524

521525
var learn = {
522526
parent_dataset_id: id,
523-
name: 'learned_' + name,
527+
name: 'learned_' + name,
524528
data_file: {filename: 'learned_' + filename},
525529
sampling: sampling
526530
};
@@ -532,7 +536,10 @@ angular
532536
sampling: -sampling
533537
};
534538

535-
return $q.all([this.create(learn), this.create(test)]);
539+
return $q.all({
540+
train: this.create(learn),
541+
test: this.create(test)
542+
});
536543
};
537544

538545
/**

0 commit comments

Comments
 (0)