I have recently installed Tabpy in my machine and integrated my tableau desktop to it. Whilst running a python code as a script real calculation, I have consistently been presented with a "float" error (see attached image). This happens even when I have added appropriate python codes to force everything into floating points. The same code runs without any issues in a normal python environment (3.6), therefore the problem only exists when porting into tableau. Specifically I have narrowed the problem down to a single line of code (more on this later). My Tableau version is 10.3.2
In the attached workbook, under the calculated field “predictions” is the python code under discussion. What this code is doing is taking some columns of data from tableau, convert into a data frame for easy manipulation. Splits the data into 2 sets. Rescale the data so that the numbers are in the range of between -1 and 1, then run a regression machine learning algorithm on the data. The algorithm I chose is a linear SVR from the sci-kit learn library which comes pre-installed with Tabpy. The problem is in the machine learning part, specifically the line regressor_svr.fit(data_train_scaled_x, data_train_scaled_y). If you remove this line (the regressor._svr.predict() line also needs to be removed), the code runs fine, add it back in, you will see the error message attached. I have put some steps into the code itself to ensure all the data are floating points. It is worth noting that as the problem only presents itself at the point of regressor_svr.fit(data_train_scaled_x, data_train_scaled_y), all the previous data manipulations must work correctly.
The questions I have are, what is causing this problem, how can I overcome this problem, and how can I ensure that it never happens again? Further, I have a suspicion that there is an incompatibility issue between Tabpy's python version (2.7) and the python version for which sci-kit learn is currently written to work with (3.x). Can anyone please advise whether this can be systematically eliminated as a root cause? If this is a cause, how would I go about fixing it, or if not possible to fix, when would tableau upgrade Tabpy python version to be 3+? I will soon upgrade to 2018.3. if a fix can be found, this fix should also work under 2018.3.
Thank you and look forward to your reply.