title: How to split data into train,test and validation sets?
body: <p>Following is my code:
  Here is the main function</p>
  
  <pre><code>trainingSet=[]
      testSet=[]
      validationSet=[]
  
      loadDataset('iris.data.txt', trainingSet, testSet,validationSet)
  </code></pre>
  
  <p>And this is the loadDataset function</p>
  
  <pre><code>def loadDataset(filename,  trainingSet=[] ,testSet=[],validationSet=[]):
      with open(filename, 'rb') as csvfile:
          lines = csv.reader(csvfile)
          dataset = list(lines)
          for x in range(len(dataset)-1):
              for y in range(4):
                  dataset[x][y] = float(dataset[x][y])
              random.shuffle(dataset)
  
  
          trainingSet .append(dataset[:106])
          testSet.append(dataset[106:128])
          validationSet.append(dataset[128:150])            
  </code></pre>
  
  <p>"loadDataset gets wine data set csv and converts it into a list of floats. Then it splits the data."          </p>
  
  <p>I am trying to split my data into 70-15-15. But when I print the lengths of each list it gives 1. </p>