] type = ['(TEST)', '(TRAIN)'] scaled = ['(PLAIN)', '(NORMALIZED)'] col = 8 valueCol = 4 bincount = 500 values = True features = False timeData = False if __name__ == '__main__': tempCWD = os.getcwd() os.chdir('D:\Workspace\NLTK comments\src\RatingPrediction') X, y, wd, td, out = getDataSets(normalize=False, selected=False) y = y[:, valueCol] print np.min(y) print np.max(y) print np.mean(y) print 'Loaded testing data\n' X_scaled = preprocessing.scale(X) print "Scaled testing Features\n" X_binned = binScaling(X[:, col], 10) print 'Binned Features' print 'Number of training rows:', len(X) os.chdir(tempCWD)
break; ind += 1 print 'Test',j," - ", DCG/float(iDCG) NDGC.append(DCG/float(iDCG)) return np.mean(NDGC), np.mean(tau) reg = True value = 1 feature = 1 if __name__ == '__main__': X0, y0, wordData,topicData,socialData, out = getDataSets(normalize=True, selected=False) y0 = y0[:,value] print out #test(X,y) if feature == 0: X0 = X0 elif feature == 1: X0 = wordData elif feature == 2: X0 = topicData elif feature == 3: X0 = np.hstack((X0,wordData)) elif feature == 4: X0 = np.hstack((X0,topicData))
] type = ["(TEST)", "(TRAIN)"] scaled = ["(PLAIN)", "(NORMALIZED)"] col = 8 valueCol = 4 bincount = 500 values = True features = False timeData = False if __name__ == "__main__": tempCWD = os.getcwd() os.chdir("D:\Workspace\NLTK comments\src\RatingPrediction") X, y, wd, td, out = getDataSets(normalize=False, selected=False) y = y[:, valueCol] print np.min(y) print np.max(y) print np.mean(y) print "Loaded testing data\n" X_scaled = preprocessing.scale(X) print "Scaled testing Features\n" X_binned = binScaling(X[:, col], 10) print "Binned Features" print "Number of training rows:", len(X) os.chdir(tempCWD)