Commit a6c9767e authored by Davis King's avatar Davis King

Minor change to made code work in python 2.6

parent 225e1c5a
...@@ -44,7 +44,7 @@ def main(): ...@@ -44,7 +44,7 @@ def main():
# Note that the correct label is predicted for each sample. # Note that the correct label is predicted for each sample.
print weights print weights
for i in range(len(samples)): 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): def predict_label(weights, sample):
"""Given the 9-dimensional weight vector which defines a 3 class classifier, predict the """Given the 9-dimensional weight vector which defines a 3 class classifier, predict the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment