MCPcopy Index your code
hub / github.com/ujjwalkarn/DataSciencePython / save_results

Function save_results

Logistic-Regression/classifier_corrected.py:42–47  ·  view source on GitHub ↗

Given a vector of predictions, save results in CSV format.

(predictions, filename)

Source from the content-addressed store, hash-verified

40
41
42def save_results(predictions, filename):
43 """Given a vector of predictions, save results in CSV format."""
44 with open(filename, 'w') as f:
45 f.write("id,ACTION\n")
46 for i, pred in enumerate(predictions):
47 f.write("%d,%f\n" % (i + 1, pred))
48
49
50def main():

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected