@@ -0,0 +1,1344 @@
+#!/usr/bin/env python2.7%0A%0Aimport sys%0Aimport math%0Aimport numpy as np%0Aimport scipy%0Afrom sklearn import linear_model%0Afrom sklearn.svm import LinearSVC%0A%0A#from sklearn.multiclass import OneVsRestClassifier%0A#from sklearn.svm import LinearSVC%0A#from sklearn.metrics import accuracy_score%0A#from sklearn import cross_validation%0A%0A%0Aif __name__ == %22__main__%22:%0A%0A    Xtest = %5B%5D%0A    Ytest = %5B%5D%0A    Train = %5B%5D%0A%0A    reader = open('./1-data/training', 'r')%0A    max_test = 100%0A    max_train = 1000%0A%0A    count = 0%0A%0A    for line in reader:%0A        max_test_reached = len(Xtest) %3E= max_test%0A        max_train_reached = len(Train) %3E= max_train%0A%0A        if max_train_reached and max_train_reached:%0A            break%0A%0A        train = np.rand() %3C 0.01 and not max_train_reached%0A        test = (not train) and np.rand() %3C 0.01 and not max_test_reached%0A%0A        if not (test or train):%0A            continue%0A%0A        def appendList(lx, ly, x, y):%0A            ly.append(x)%0A            ly.append(y)%0A%0A        line = line.strip().split(' ')%0A        a = line.pop(0)%0A        b = %22 %22.join(line)%0A%0A        if test:%0A            Xtest.append(a)%0A            Ytest.append(b)%0A        else:%0A            Train.append(line)%0A%0Aopen('./1-data/training.txt', 'w').writelines(Train)%0Aopen('./1-data/test_data.txt', 'w').writelines(Xtest)%0Aopen('./1-data/test_labels.txt', 'w').writelines(Ytest)%0A%0A%0A%0A

generate data script