Skip to content

Commit

Permalink
Update run.py
Browse files Browse the repository at this point in the history
Updated comments
  • Loading branch information
AdrienneMendrik authored Mar 10, 2024
1 parent c364683 commit 4879569
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions run.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
"""
This is an example script to generate the outcome variable given the input dataset.
This script calls submission.py. Add your method to submission.py to run your
prediction method.
This script should be modified to prepare your own submission that predicts
the outcome for the benchmark challenge by changing the predict_outcomes function.
To test your submission use the following command:
The predict_outcomes function takes a Pandas data frame. The return value must
be a data frame with two columns: nomem_encr and outcome. The nomem_encr column
should contain the nomem_encr column from the input data frame. The outcome
column should contain the predicted outcome for each nomem_encr. The outcome
should be 0 (no child) or 1 (having a child).
python run.py predict
The script can be run from the command line using the following command:
For example:
python run.py input_path
An example for the provided test is:
python run.py data/test_data_liss_2_subjects.csv
python run.py predict data/PreFer_fake_data.csv PreFer_fake_data_predictions.csv
"""

import sys
Expand Down Expand Up @@ -46,6 +38,15 @@


def predict(input_path, output):
"""Predict Score (evaluate) the predictions and write the metrics.
This function takes the path to an input CSV file containing the input data.
It calls submission.py clean_df and predict_outcomes writes the predictions
to a new output CSV file.
This function should not be modified.
"""

if output is None:
output = sys.stdout
df = pd.read_csv(
Expand Down

0 comments on commit 4879569

Please sign in to comment.