Skip to content

Commit 3a5c787

Browse files
Merge pull request #762 from DashAISoftware/fix/predict-cols
Predict save the cols of the full dataset
2 parents 83a7d6d + 481b833 commit 3a5c787

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

DashAI/back/job/predict_job.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ def run(
422422
manual_input_data, dataset_trained_path
423423
)
424424

425-
prepared_dataset, y_pred = _run_prediction_pipeline(
425+
_, y_pred = _run_prediction_pipeline(
426426
task=task,
427427
trained_model=trained_model,
428428
train_dataset=train_dataset,
@@ -460,9 +460,13 @@ def run(
460460
full_path = Path(path) / folder_name
461461
full_path.mkdir(parents=True, exist_ok=True)
462462

463-
# Add predictions to loaded dataset
463+
output_col = model_session.output_columns[0]
464+
base_columns = [
465+
col for col in loaded_dataset.column_names if col != output_col
466+
]
467+
output_dataset = loaded_dataset.select_columns(base_columns)
464468
dataset_with_prediction = to_dashai_dataset(
465-
prepared_dataset.add_column(model_session.output_columns[0], y_pred)
469+
output_dataset.add_column(output_col, y_pred)
466470
)
467471

468472
# Filter schema from trained dataset

0 commit comments

Comments
 (0)