Skip to content
Snippets Groups Projects
Commit e68ee843 authored by jh1724's avatar jh1724
Browse files

move predictions out

parent 32d5dc1e
No related branches found
No related tags found
No related merge requests found
......@@ -105,9 +105,9 @@ def main():
random_state=62)
model.fit(training_x, training_y)
predictions = model.predict(testing_x)
# Make predictions
if testing_y is not None:
predictions = model.predict(testing_x)
# calculate metrics
f3_score = fbeta_score(testing_y, predictions, beta=3)
accuracy = accuracy_score(testing_y, predictions)
......@@ -115,6 +115,7 @@ def main():
print(f"Accuracy: {accuracy}")
# Write predictions to aki.csv
predictions_df = pd.DataFrame(predictions, columns=['aki'])
predictions_df['aki'] = predictions_df['aki'].map({0: 'n', 1: 'y'})
predictions_df.to_csv(flags.output, index=False)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment