Commit f7409d2a authored by SHREYANSH JAIN's avatar SHREYANSH JAIN

ytest[ytest<0] = 0

parent b311859a
This diff is collapsed.
...@@ -265,11 +265,11 @@ def main(): ...@@ -265,11 +265,11 @@ def main():
errlog = model.train(xtrainprocessed, ytrainprocessed, loss_fn, loss_grad, args.epoch, args.lr) errlog = model.train(xtrainprocessed, ytrainprocessed, loss_fn, loss_grad, args.epoch, args.lr)
ytest = model.predict(xtestprocessed) ytest = model.predict(xtestprocessed)
ytest = ytest.astype('int') ytest = ytest.astype('int')
ytest = [np.absolute(i) for i in ytest] ytest[ytest<0] = 0
print(ytest) print(ytest)
output = [(i,ytest[i]) for i in range(len(ytest))] output = [(i,ytest[i]) for i in range(len(ytest))]
np.savetxt("prediction.csv",output,delimiter=',',fmt="%d",header="instance (id),count",comments='') np.savetxt("prediction.csv",output,delimiter=',',fmt="%d",header="instance (id),count",comments='')
# np.savetxt("error.log",errlog,delimiter='\n',fmt="%f") #np.savetxt("error.log",errlog,delimiter='\n',fmt="%f")
if __name__ == '__main__': if __name__ == '__main__':
......
This diff is collapsed.
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