Skip to content

Fix Model Selection in batch_predict Endpoint#54

Merged
KarinePistili merged 3 commits into
ruxailab:mainfrom
sohampirale:fix/hardcoded_coded_for_gaze_prediction
Jun 8, 2026
Merged

Fix Model Selection in batch_predict Endpoint#54
KarinePistili merged 3 commits into
ruxailab:mainfrom
sohampirale:fix/hardcoded_coded_for_gaze_prediction

Conversation

@sohampirale

Copy link
Copy Markdown
Contributor

Description:

This PR resolves an issue where the batch_predict endpoint was ignoring
user-selected ML models and always using hardcoded Ridge regression models.

Fixes : #53

Changes Made:

  • Created a models_gaze_engineered dictionary for X-axis models that operate
    on the 5-feature engineered input space.
  • Reused the existing models dictionary for Y-axis models that operate
    on the 2-feature input space.
  • Updated the batch_predict function to correctly pass model parameters
    to predict_new_data_simple.
  • Standardized parameter naming to model_name_X and model_name_Y
    for improved consistency and clarity.

Problem Solved:

Previously, users could select different ML models in the frontend, but the
batch_predict endpoint always defaulted to Ridge regression, ignoring
the selected options. This change ensures that the chosen models are
properly propagated through the backend and used for real-time gaze
prediction as intended.

Files Changed:

  • /app/routes/session.py — Updated batch_predict function
  • /app/services/gaze_tracker.py — Added models_gaze_engineered
    dictionary and updated predict_new_data_simple

Screenshots : All models are working

  • Tested this endpoint with all the models we support on frontend(Ruxailab)
Screenshot from 2026-02-07 15-49-38 Screenshot from 2026-02-07 15-49-48

…-feature X-axis prediction and enables proper model selection for predict_new_data_simple function
@KarinePistili
KarinePistili merged commit 612eb18 into ruxailab:main Jun 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Model Selection Ignored in batch_predict Endpoint - Always Uses Hard coded Ridge Regression

2 participants