GithubHelp home page GithubHelp logo

Comments (5)

vruusmann avatar vruusmann commented on August 18, 2024

The value of the EvaluationResponse@id attribute is the same as the EvaluationRequest@id attribute. Does your evaluation request JSON object have a non-null Id?

I just tested relevant Openscoring REST API endpoints using the curl command-line application (copy-pasted examples from the README file) and everything works just fine. Have you tested your CSV file with the curl command-line application already?

What is your "requests" Python package version?

from openscoring-python.

saffrydaffry avatar saffrydaffry commented on August 18, 2024

I haven't tried cURL yet, once I try sending a request to /csv I'll post the results. My requests library version is 2.18.4.

Thanks

from openscoring-python.

saffrydaffry avatar saffrydaffry commented on August 18, 2024

I just tested using cURL and the /csv with

curl -X POST --data-binary @features.csv -H "Content-type: text/plain; charset=UTF-8" http://localhost:8080/openscoring/model/testmodel/csv > curl_output.csv

and it looks like from cURL the ID's are processed correctly:

head curl_output.csv
id,true_label,probability_0,probability_1
57977,0,0.9991488452182992,8.511547817011017E-4
31721,0,0.9779992879224841,0.022000712077515847
55943,0,0.9779992879224841,0.022000712077515847
35826,0,0.9929877781321543,0.00701222186784629

This is using the same file as previously. I'm not sure why curl and python would give different results?

from openscoring-python.

vruusmann avatar vruusmann commented on August 18, 2024

I have added a unit test to demonstrate that everything works as advertised:
https://github.com/openscoring/openscoring-python/blob/master/openscoring/tests/__init__.py#L12-L51

In my computer, this test passes cleanly with Python 2.7 (+requests 2.10) and Python 3.4 (+requests 2.18):

$ cd openscoring-python
$ nosetests-2.7
$ nosetests-3.4

The output on both cases is this:

Ran 7 tests in 0.281s

OK

Also, there's a new method Openscoring.evaluateDataFrame(id, df), which deals with in-memory Pandas' DataFrame objects (as opposed to CSV files). Their formatting and parsing uses fixed delimiter and quote chars, and therefore should be less error prone.

Anyway, my resolution is that the Openscoring-Python client library is correct, and the problem is located somewhere in your computer.

from openscoring-python.

saffrydaffry avatar saffrydaffry commented on August 18, 2024

I will continue to look at my setup, it does seem like it's something in my system. Thanks for adding the evaluateDataFrame method. I look forward to trying it out.

Thanks for all your help!

from openscoring-python.

Related Issues (12)

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.