Git Product home page Git Product logo

openscoring-python's Introduction

Openscoring-Python

Python client library for the Openscoring REST web service.

Prerequisites

  • Python 2.7, 3.4 or newer.

Installation

Installing a release version from PyPI:

pip install openscoring

Alternatively, installing the latest snapshot version from GitHub:

pip install --upgrade git+https://github.com/openscoring/openscoring-python.git

Usage

Creating an Openscoring object:

from openscoring import Openscoring

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

Deploying a PMML document DecisionTreeIris.pmml as an Iris model:

os.deployFile("Iris", "DecisionTreeIris.pmml")

Evaluating the Iris model with a data record:

arguments = {
	"Sepal.Length" : 5.1,
	"Sepal.Width" : 3.5,
	"Petal.Length" : 1.4,
	"Petal.Width" : 0.2
}

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

The same, but wrapping the data record into an EvaluationRequest object for request identification purposes:

from openscoring import EvaluationRequest

evaluationRequest = EvaluationRequest("record-001", arguments)

evaluationResponse = os.evaluate("Iris", evaluationRequest)
print(evaluationResponse.results)

Evaluating the Iris model with data records from the Iris.csv CSV file, storing the results to the Iris-results CSV file:

os.evaluateCsvFile("Iris", "Iris.csv", "Iris-results.csv")

Undeploying the Iris model:

os.undeploy("Iris")

De-installation

Uninstall:

pip uninstall openscoring

License

Openscoring-Python is licensed under the terms and conditions of the GNU Affero General Public License, Version 3.0.

Additional information

Openscoring-Python is developed and maintained by Openscoring Ltd, Estonia.

Interested in using Java PMML API or Openscoring REST API software in your company? Please contact [email protected]

openscoring-python's People

Contributors

vruusmann avatar sebasfens4 avatar sebastianf101 avatar

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.