Skip to content

Commit

Permalink
load parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
orbxball committed Mar 13, 2017
1 parent 6f832b1 commit ab10c10
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion hw1/kaggle_best.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def extract_feature(M, features, cubics):

# Start Program
infile1, infile2, outfile = sys.argv[1], sys.argv[2], sys.argv[3]
para_permu = 'para/test2.permu'

# preprocessing on infile1
M = pd.read_csv(infile1, encoding='big5').as_matrix() #shape: (4320, 27)
Expand All @@ -48,7 +49,11 @@ def extract_feature(M, features, cubics):

#valid data
valid_num = 1000
permu = np.random.permutation(x_data.shape[0])
try:
permu = np.loadtxt(para_permu, delimiter=',')
permu = permu.astype(int)
except:
permu = np.random.permutation(x_data.shape[0])
x_data_valid = x_data[permu[:valid_num], :]
y_data_valid = y_data[permu[:valid_num]]
x_data = x_data[permu[valid_num:], :]
Expand Down

0 comments on commit ab10c10

Please sign in to comment.