A FastAPI application designed for training classification models encounters a peculiar issue where all hyperparameters are received as strings, regardless of their intended data types like integers, floats, or booleans. This problem persists even after explicit type conversion attempts. The application uses a structured payload where parameters such as ‘penalty’, ‘dual’, ‘tol’, ‘C’, ‘fit_intercept’, ‘intercept_scaling’, ‘class_weight’, ‘solver’, ‘max_iter’, ‘multi_class’, ‘n_jobs’, ‘random_state’, ‘warm_start’, ‘verbose’, and ‘l1_ratio’ are defined. Despite the payload containing values like 0.001 for ‘tol’, 1 for ‘C’, and ‘True’ for ‘fit_intercept’, the system interprets all these as strings. This anomaly affects the model’s performance and requires manual type conversion to ensure correct data handling.
Source: stackoverflow.com















