I encountered an issue when using the custom_input feature with my own dataset, which contains integer values. When I tried to inject an anomaly into my data, I received a numpy.core._exceptions._UFuncOutputCastingError. This error occurred because the apply_variations function in the Consolidator class tried to add float64 values (from bo.noise, bo.trend_series, and bo.offset) to my int64 time series data, resulting in a type mismatch.
Here is the error message:
numpy.core._exceptions._UFuncOutputCastingError: Cannot cast ufunc 'add' output from dtype('float64') to dtype('int64') with casting rule 'same_kind'
This error occurred at the following line in the consolidator.py file:
The documentation for the CustomInput class does not explicitly state that the input data must be of type float, but I guess in general gutenTAG is designed to work with floating-point time series data.
Suggested Fix:
To prevent this error, I suggest adding a simple check in the CustomInput class to ensure that the input data is of type float. If the data is of type integer, we can automatically convert it to float (maybe with a warning to inform the user).
Thanks for spotting this bug and suggesting a fix. You are right that we were short-sighted regarding our input types, and your suggestion makes sense!
Hello,
I encountered an issue when using the
custom_input
feature with my own dataset, which contains integer values. When I tried to inject an anomaly into my data, I received anumpy.core._exceptions._UFuncOutputCastingError
. This error occurred because theapply_variations
function in theConsolidator
class tried to addfloat64
values (frombo.noise
,bo.trend_series
, andbo.offset
) to myint64
time series data, resulting in a type mismatch.Here is the error message:
This error occurred at the following line in the
consolidator.py
file:The documentation for the
CustomInput
class does not explicitly state that the input data must be of type float, but I guess in general gutenTAG is designed to work with floating-point time series data.Suggested Fix:
To prevent this error, I suggest adding a simple check in the
CustomInput
class to ensure that the input data is of type float. If the data is of type integer, we can automatically convert it to float (maybe with a warning to inform the user).