Error "cannot convert float NaN to integer" when training (fit) an Isolation Forest model #1138
-
Hi, After doing some tests, I noticed that the ocurrence of this issue depends on the positioning of the columns in the list passed as the 'X' parameter to the 'fit' function. This is weird because all 4 columns have the same Numeric data type but when column 'recurrencia_solicita_norm' is the first element in the list passed as the X parameter in fit function, this error does not occur, however, when this column is the last element in the list, this error appears. The erro trace follows below: print(PROPERTIES['COLUMNAS_MODELO_1']) ValueError Traceback (most recent call last) File ~/verticapyenv/lib/python3.11/site-packages/verticapy/machine_learning/vertica/base.py:7980, in Unsupervised.fit(self, input_relation, X, return_report) File ~/verticapyenv/lib/python3.11/site-packages/verticapy/machine_learning/vertica/ensemble.py:4235, in IsolationForest.compute_attributes(self) File ~/verticapyenv/lib/python3.11/site-packages/verticapy/machine_learning/vertica/base.py:2487, in Tree._compute_trees_arrays(self, tree, X, return_probability) ValueError: cannot convert float NaN to integer |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hello, I would like to give you an update based on further tests performed. This issue occurs when the variables used to traind the Isolation Forest model have floating-point values and not integer values., In our case, the variables passed to the Isolation Forest model are first normalized using the Z-score normalization method, which produces floating-point valuies and then passed to the model. |
Beta Was this translation helpful? Give feedback.
Thank you so much for reporting this. We have investigated this issue and found out that there is a minor bug at the Vertica Server side. We will fix it on priority.
Meanwhile in order to work with your model we recommend converting your INTEGER data type columns that you are using as input to NUMERIC. Do it before scaling. This should work.