src/convnet_magicnet.js
function() {
      var N = this.data.length;
      var num_train = Math.floor(this.train_ratio * N);
      this.folds = []; // flush folds, if any
      for(var i=0;i<this.num_folds;i++) {
        var p = randperm(N);
        this.folds.push({train_ix: p.slice(0, num_train), test_ix: p.slice(num_train, N)});
      }
    }
function() {
      var N = this.data.length;
      var num_train = Math.floor(this.train_ratio * N);
      this.folds = []; // flush folds, if any
      for(var i=0;i<this.num_folds;i++) {
        var p = randperm(N);
        this.folds.push({train_ix: p.slice(0, num_train), test_ix: p.slice(num_train, N)});
      }
    }
function ( ) { var N = this . data . length ; var num_train = Math . floor ( this . train_ratio * N ) ; this . folds = [ ] ; // flush folds, if any for ( var i = 0 ; i < this . num_folds ; i ++ ) { var p = randperm ( N ) ; this . folds . push ( { train_ix : p . slice ( 0 , num_train ) , test_ix : p . slice ( num_train , N ) } ) ; } }
sets this.folds to a sampling of this.num_folds folds
sets this . folds to a sampling of this . num_folds folds