Fix prediction target encoded#322
Merged
Merged
Conversation
cristian-tamblay
approved these changes
Oct 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors how predictions are processed across different machine learning tasks in the DashAI backend. It introduces a unified
process_predictionsmethod in the base task class, implements task-specific logic for classification tasks, and updates related endpoints and job logic to use this new structure. The changes improve code modularity, make prediction handling more consistent, and simplify the addition of new task types.Task Abstraction and Prediction Processing
process_predictionsmethod toBaseTask, requiring all tasks to define how predictions are processed.process_predictionsinClassificationTask, converting model outputs to class labels using dataset metadata, and updated all classification task types (ImageClassificationTask,TabularClassificationTask,TextClassificationTask) to inherit fromClassificationTaskinstead ofBaseTask. [1] [2] [3] [4]process_predictionsfor regression and translation tasks to simply return predictions as-is, maintaining compatibility. [1] [2]Dataset Utilities and Label Encoding
encode_labelsutility to encode categorical columns into numerical labels and generate aClassLabelfeature, used by classification tasks for prediction processing. [1] [2]Prediction Job and API Endpoint Updates
process_predictionsmethod, loading the appropriate task from the registry and handling dataset loading errors more robustly. [1] [2]/predict_summaryAPI endpoint to extract prediction metadata, determine output data types using the task class, and compute class distributions for classification tasks using the updated structure. [1] [2]Before

After
