Problem
- When scoring a structured data model, there was a very large difference between scoring the entire dataset and scoring by stratification
- Calculation error
Cause
-
One shape was a pandas Series and the other was a pandas DataFrame. This was the difference between a 2D array and a 1D array.
-
When implementing SMAPE, the shapes of the ground truth (pandas Series) and prediction (pandas DataFrame) data were different -> (n,) and (n,1)
-
When using NumPy in SMAPE, broadcasting automatically expanded the dimensions, resulting in an incorrect calculation
-
When mixing 1D and 2D arrays, broadcasting caused unintended calculations
Solution
- Flatten the DataFrame values and proceed