Hello,
in Java I need to split a list and generate a TEST and TRAINING set list; I did this below that doesn't work because of an exception during of the 'removeAll'; is it a good way to do it? how can I do that RemoveALL? thanks
Qt Code:
  1. File dir = new File("..\\..\\dir");
  2. String[] files = dir.list();
  3. int block = files.length*9/10;
  4. for (int numbOfTest=0; numbOfTest < 10; numbOfTest++ ) {
  5. List<String> list = Arrays.asList(files);
  6. List<String> listTEST = list.subList( numbOfTest*block, block);
  7. Collection<String> c = listTEST;
  8. //now list will be the training list
  9. list.removeAll( list ); //error
To copy to clipboard, switch view to plain text mode