Sustainable Development Goals (SDGs): Text Classification Challenge
am having issues with generating the submission file using Python, for me instead of generating an array of 0 and 1s am getting something not likable some thing like a dictionary.and when i try to tabulate the result into a dataframe things just fill as it was from the dictionary. something like a column heading 3.b.1 than gets same data through the whole column down.
Any hit about it.
I was able to get the right kind of format, by using the column names from the submission fourm, then creating a new data frame from my predition output numpy array. So you can have some code like:
# some numpy array of predictions from model Y = model.predict(X) # columns names for output cols = open('Devex_submission_format.csv').readline().replace('\n', '').split(',') # build output dataframe, Where index is the Unique ID col output = pd.DataFrame(Y, index=X.index, columns=cols[1:]) # save for submission output.to_csv('awesome_submission.csv')
I hope that helps