Skip to main content

Python 3 implementation of Portable Format for Analytics (PFA): producer, converter, and consumer.

Project description

Build Status Maintenance GitHub Twitter Follow

Data Scientist: Why is my cutting edge model still not in production?

Scenario 1:

IT Team: We are still implementing the scoring engine in Go/Java/C++.

Scenario 2:

IT Team: We are still figuring out how to read the model.pkl file you provided in Java.

. .

and the push to production pang continues ..

New Features!

  • Supports Python 3.4+
  • scripts/pfachain can combine 2 or more PFA documents

Changes in titus v1.0.0

View the complete changelog here.

Titus for Python 3.4+ - Portable Format for Analytics (PFA) implementation

This is a subset-fork of the original repository which has been completely migrated to Python 3.

The Portable Format for Analytics (PFA) is a specification for scoring/inference engines: event-based processors that perform predictive or analytic calculations. It is a model interchange format which helps smoothen the transition from statistical model development to large-scale and/or online production.

PFA

Titus (Python 2) (API) was originally Open Data's complete implementation of PFA for Python. It can be used for model development as well as to execute the scoring engine.

Requirements

Titus uses a number of open source projects to work properly:

  • avro-python3
  • numpy
  • pytz
  • pyyaml
  • ply

The above packages are available via pip and are automatically installed during setup.

Installation

Titus requires Python 3.4+ to run. It can be installed via pip/pip3 as follows:

$ pip install titus2

or you can directly install the latest build from github repository via

$ pip install git+https://github.com/animator/python3-titus.git

After installation please run the following elementary example in python

from titus.genpy import PFAEngine

pfa = {"input": "double",
 "output": "double",
 "action": [
   {"+": ["input", 100]}
 ]}
engine, = PFAEngine.fromJson(pfa)

l = [1.0, 2.0, 3.0, 4.0, 5.0]

for num in l:
    print(num, engine.action(num))

User Guide and Tutorials

See the Hadrian wiki for user guide and tutorials.

Current Testing Framework

  • Unit testing status available here Build Status
  • Conformance testing status available here Build Status

Issues and Feature Requests

Please raise an issue here.

Development

Want to contribute? Great!

Please raise an issue and send a pull request.

Todos

  • Write MORE Tests for scripts/*.
  • Add scikit-learn model export to PFA tutorials.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

titus2-1.0.0a0.tar.gz (277.5 kB view hashes)

Uploaded Source

Built Distribution

titus2-1.0.0a0-py2.py3-none-any.whl (312.5 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page