Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Openscoring.deploy method throws exception "No Json Object could be decoded" #4

Closed
gdhruv80 opened this issue Oct 7, 2017 · 2 comments

Comments

@gdhruv80
Copy link

gdhruv80 commented Oct 7, 2017

Hey I was trying to use your openscoring-python library to score a simple PMML model infact the exact same model that you have developed in sklearn2pmml library (DecisionTreeIris.pmml). The final aim is to develop a PMML model in R and score it in python using your openscoring library. When I run the code its giving a error in the os.deploy line - No Json Object could be decoded
Could you please help on what is going on here? Thanks !! (Below is the attached code and I am using Jupytr notebook !)
import pandas

path='/projects/wakari/MT_SNAP_Eligibility/SNAP_Generic_Modules/Module_6_Generic_PMML_Creation/'
iris_df = pandas.read_csv(path + 'iris.csv',header=0)

from sklearn2pmml import PMMLPipeline
from sklearn.tree import DecisionTreeClassifier

iris_pipeline = PMMLPipeline([
("classifier", DecisionTreeClassifier())
])
iris_pipeline.fit(iris_df[iris_df.columns.difference(["Species"])], iris_df["Species"])

from sklearn2pmml import sklearn2pmml

sklearn2pmml(iris_pipeline, "DecisionTreeIris.pmml", with_repr = True)

import openscoring

os = openscoring.Openscoring("http://localhost:8080/openscoring")

kwargs = {"auth" : ("admin", "adminadmin")}

RUNS FINE TILL HERE

os.deploy("Iris", "DecisionTreeIris.pmml", **kwargs)

arguments = {
"Sepal_Length" : 5.1,
"Sepal_Width" : 3.5,
"Petal_Length" : 1.4,
"Petal_Width" : 0.2
}

result = os.evaluate("Iris", arguments)
print(result)

@vruusmann vruusmann changed the title Hey I was trying to use your openscoring-python library to score a simple PMML model infact the exact same model that you have developed in sklearn2pmml library (DecisionTreeIris.pmml). The next step would be to develop a PMML in R and score it in python using your openscoring library. When I run the code its giving a error in the os.deploy line - No Json Object could be decoded. Could you please help on what is going on here? Thanks !! (Below is the attached code) The Openscoring.deploy method throws exception "No Json Object could be decoded" Oct 7, 2017
@vruusmann
Copy link
Member

os = openscoring.Openscoring("http://localhost:8080/openscoring")
os.deploy("Iris", "DecisionTreeIris.pmml", **kwargs)

Is there an Openscoring REST web service listening on port 8080 of your computer?

You need to start the server first. Otherwise, the client has nowhere to connect to.

@gdhruv80
Copy link
Author

gdhruv80 commented Oct 9, 2017

Oh okay ! I am not so good with this any idea how I can do this? (If you could point me to a page with list of directions).

Thanks a lot !
Dhruv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants