.. _Scoring_Pipeline:

The Python and MOJO Scoring Pipelines
=====================================

Driverless AI provides a Python Scoring Pipeline for experiments and interpreted models and a MOJO (Java-based) Scoring Pipeline for experiments.

The Python Scoring Pipeline is implemented as a Python whl file. While this allows for a single process scoring engine, the scoring service is generally implemented as a client/server architecture and supports interfaces for TCP and HTTP.  

The MOJO Scoring Pipeline provides a standalone scoring pipeline that converts experiments to MOJOs, which can be scored in real time.

Examples are included with each scoring package.

Which Pipeline Should I Use?
----------------------------

Driverless AI provides a Python Scoring Pipeline, an MLI Standalone Scoring Pipeline, and a MOJO Scoring Pipeline. Consider the following when determining the scoring pipeline that you want to use.

- For all pipelines, the higher the accuracy, the slower the scoring. 
- The Python Scoring Pipeline is slower but easier to use than the MOJO scoring pipeline. 
- When running the Python Scoring Pipeline:

  - HTTP is easy and is supported by virtually any language. HTTP supports RESTful calls via curl, wget, or supported packages in various scripting languages. 
  - TCP is a bit more complex, though faster. TCP also requires Thrift, which currently does not handle NAs.

- Use the MOJO Scoring Pipeline for a pure Java solution. This solution is flexible and is faster than the Python Scoring Pipeline, but it requires a bit more coding. 
- The MLI Standalone Python Scoring Pipeline can be used to score interpreted models but only supports k-LIME reason codes.

  - For obtaining k-LIME reason codes from an MLI experiment, use the MLI Standalone Python Scoring Pipeline. k-LIME reason codes are available for all models.
  - For obtaining Shapley reason codes from an MLI experiment, use the DAI Standalone Python Scoring Pipeline. Shapley is only available for XGBoost and LightGBM models. Note that obtaining Shapley reason codes through the Python Scoring Pipeline can be time consuming.

.. _Python_Pipeline:

.. include:: scoring-standalone-python.rst


.. include:: scoring-mli-standalone-python.rst

.. _Mojo_Pipeline:

.. include:: scoring-mojo-scoring-pipeline.rst
