Code Monkey home page Code Monkey logo

Comments (5)

BBeran avatar BBeran commented on May 23, 2024 1

Hi Brit,
Tableau passes the objects as Python lists. Does it work when you delete the [ ] around testing_data object in your predictSpam function?

Thanks,

Bora

from tabpy.

BBeran avatar BBeran commented on May 23, 2024

Hi Brit,
Can you make sure your TabPy server and IPython workbook you're using have the same version of Python? The piece of code that is triggered here takes different number of arguments in Python 2.x vs 3.x. That is my first guess on why this might be happening. If that's not the issue, I will dig deeper.

Thanks,

Bora

from tabpy.

databrit avatar databrit commented on May 23, 2024

That was part of the issue - thank you!

When it comes to passing data from Tableau to the function it doesn't work and I'm wondering if it has to do with data types. The use case is simple - pass text via a parameter in Tableau to the model and return 0 or 1 (cast as a string).

In my function, I originally returned a numpy array while in Tableau I was using SCRIPT_STR. I thought perhaps that since it could take multiple strings and return a list of results that I could simply return 1 since I'm passing one argument in Tableau. I tried so resolve that and tested it in my notebook to ensure the data I was returning to Tableau was a string.

screen shot 2017-05-07 at 9 59 32 am

In Tableau, my calculation is:

screen shot 2017-05-07 at 10 03 07 am

The parameter:

screen shot 2017-05-07 at 10 00 58 am

The error it returns:

screen shot 2017-05-07 at 9 58 43 am

Is there something I am missing with how the data is passed in the string parameter in Tableau? Would it not be read as a string by the function? Or, is there a different way I need to deploy my code? I think another reason why it may not work is because I'm only deploying the function but it calls something earlier in my notebook. I was trying to save a trained model versus needing to retrain each time.

I've verified that TabPy is running and the function endpoint exist. Any recommendations?

Workbook: https://github.com/GirlMeetsData/data_analysis/blob/master/SpamPredictor.twbx

Update - Dug up this error: ERROR:tabpy_client.custom_query_object:Exception hit when running custom query, error: 'list' object has no attribute 'lower'

from tabpy.

databrit avatar databrit commented on May 23, 2024

Yes!!! Bora, thanks for your patience 👍

from tabpy.

BBeran avatar BBeran commented on May 23, 2024

I am glad it worked.

from tabpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.