Skip to content

Commit

Permalink
changed test labels from 0 to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
zygmuntz committed Nov 24, 2017
1 parent 667fc79 commit f2017a5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions csv2vw.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import sys, csv, re

test_label = '1'

def get_label( status ):
statuses = ['not a real question', 'not constructive', 'off topic', 'open', 'too localized']
label = statuses.index( status ) + 1
Expand Down Expand Up @@ -31,7 +33,7 @@ def get_label( status ):
if status != '0':
label = get_label( status )
else:
label = status # test set
label = test_label

output_line = "%s %s %s" % ( label, 1, post_id ) # weight is 1
output_line += "|n %s %s" % ( reputation, good_posts )
Expand All @@ -41,4 +43,4 @@ def get_label( status ):
o.write( output_line )

if counter % 100000 == 0:
print counter
print counter

0 comments on commit f2017a5

Please sign in to comment.