code: function importTrainData() {
        var csv_txt = $('#data-ta').val();
        var arr = $.csv.toArrays(csv_txt);
        var arr_train = arr;
        var arr_test = [];
  
        var test_ratio = Math.floor($("#testsplit").val());
        if(test_ratio !== 0) {
          // send some lines to test set
          var test_lines_num = Math.floor(arr.length * test_ratio / 100.0);
          var rp = randperm(arr.length);
          arr_train = [];
          for(var i=0;i<arr.length;i++) {
            if(i<test_lines_num) {
              arr_test.push(arr[rp[i]]);
            } else {
              arr_train.push(arr[rp[i]]);
            }
          }
          // enter test lines to test box
          var t = "";
          for(var i=0;i<arr_test.length;i++) {
            t+= arr_test[i].join(",")+"\n";
          }
          $("#data-te").val(t);
          $("#datamsgtest").empty();
        }
  
        $("#prepromsg").empty(); // flush
        SUCC("#prepromsg", "Sent " + arr_test.length + " data to test, keeping " + arr_train.length + " for train.");
        train_import_data = importData(arr_train,'#datamsg');
        train_dataset = makeDataset(train_import_data.arr, train_import_data.colstats);
        return train_dataset;
      }
docs: globals