Minor change to made code work in python 2.6

This commit is contained in:
Davis King 2013-07-08 21:32:09 -04:00
parent 225e1c5ab0
commit a6c9767e6b
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ def main():
# Note that the correct label is predicted for each sample.
print weights
for i in range(len(samples)):
print "predicted label for sample[{}]: {}".format(i, predict_label(weights, samples[i]))
print "predicted label for sample[{0}]: {1}".format(i, predict_label(weights, samples[i]))
def predict_label(weights, sample):
"""Given the 9-dimensional weight vector which defines a 3 class classifier, predict the