Skip to content

Commit 447ff85

Browse files
gustavocidornelaswhoseoyster
authored andcommitted
Rename 'predictions' column to 'output' for all model runners
1 parent 4c93ae1 commit 447ff85

File tree

6 files changed

+10
-12
lines changed

6 files changed

+10
-12
lines changed

examples/llms/general-llm/product-names.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@
356356
"outputs": [],
357357
"source": [
358358
"# There are costs in running this cell!\n",
359-
"dataset[\"model_output\"] = llm_runner.run(dataset)[\"predictions\"]"
359+
"dataset[\"model_output\"] = llm_runner.run(dataset)[\"output\"]"
360360
]
361361
},
362362
{

examples/llms/ner/entity-extraction.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@
389389
"outputs": [],
390390
"source": [
391391
"# There are costs in running this cell!\n",
392-
"dataset[\"model_output\"] = llm_runner.run(dataset)[\"predictions\"]"
392+
"dataset[\"model_output\"] = llm_runner.run(dataset)[\"output\"]"
393393
]
394394
},
395395
{

openlayer/model_runners/ll_model_runners.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def _run_in_memory_and_yield_progress(
104104
model_outputs.append(output_value)
105105
current_row += 1
106106
yield pd.DataFrame(
107-
{"predictions": model_outputs, "output_time_utc": timestamps}
107+
{"output": model_outputs, "output_time_utc": timestamps}
108108
), current_row / total_rows
109109
continue
110110

@@ -117,7 +117,7 @@ def _run_in_memory_and_yield_progress(
117117
current_row += 1
118118

119119
yield pd.DataFrame(
120-
{"predictions": model_outputs, "output_time_utc": timestamps}
120+
{"output": model_outputs, "output_time_utc": timestamps}
121121
), current_row / total_rows
122122

123123
self.logger.info("Successfully ran data through the model!")
@@ -126,7 +126,7 @@ def _run_in_memory_and_yield_progress(
126126
self.cost_estimates.append(run_cost)
127127

128128
yield pd.DataFrame(
129-
{"predictions": model_outputs, "output_time_utc": timestamps}
129+
{"output": model_outputs, "output_time_utc": timestamps}
130130
), 1.0
131131

132132
def _run_single_input(self, input_data_row: pd.Series) -> Tuple[str, float, set]:

openlayer/model_runners/prediction_jobs/classification_prediction_job.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@
3434

3535
# Run model
3636
logger.debug("Running model...")
37-
output_data = pd.DataFrame(
38-
{"predictions": ml_model.predict_proba(input_data).tolist()}
39-
)
37+
output_data = pd.DataFrame({"output": ml_model.predict_proba(input_data).tolist()})
4038

4139
# Save output data
4240
logger.debug("Saving output data...")

openlayer/model_runners/prediction_jobs/regression_prediction_job.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
# Run model
3636
logger.debug("Running model...")
37-
output_data = pd.DataFrame({"predictions": ml_model.predict(input_data)})
37+
output_data = pd.DataFrame({"output": ml_model.predict(input_data)})
3838

3939
# Save output data
4040
logger.debug("Saving output data...")

openlayer/model_runners/traditional_ml_model_runners.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ def _post_process_output(self, output_data: pd.DataFrame) -> pd.DataFrame:
110110
processed_output_data = output_data.copy()
111111

112112
# Make the items list of floats (and not strings)
113-
processed_output_data["predictions"] = processed_output_data[
114-
"predictions"
115-
].apply(ast.literal_eval)
113+
processed_output_data["output"] = processed_output_data["output"].apply(
114+
ast.literal_eval
115+
)
116116

117117
return processed_output_data
118118

0 commit comments

Comments
 (0)