Module Expr Str Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Import alias identifier Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Call NameLoad NameLoad FunctionDef arguments args NameParam NameParam defaults Num body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword Num Assign NameStore Call NameLoad NameLoad Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list ClassDef bases body Expr Str Assign NameStore Dict Str Str Str Str NameLoad NameLoad NameLoad Lambda arguments args NameParam defaults CompareEq Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults TupleLoad NameLoad kwarg body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad Call NameLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body TryExcept body Return Call AttributeLoad NameLoad attr NameLoad NameLoad handlers ExceptHandler type NameLoad name NameStore body Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr ListLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr orelse Assign NameStore NameLoad Assign NameStore ListLoad For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore ListLoad For TupleStore NameStore NameStore AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad NameLoad Index NameLoad Return Call AttributeLoad NameLoad attr NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Dict For TupleStore NameStore NameStore AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad If CompareIn NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call NameLoad SubscriptLoad NameLoad Index NameLoad orelse If Call NameLoad NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults kwarg body If AttributeLoad NameLoad attr body Return Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr If NameLoad body Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore Dict Str Str Call NameLoad NameLoad Return Call NameLoad NameLoad keyword Num decorator_list FunctionDef arguments args NameParam NameParam defaults body If Call NameLoad NameLoad NameLoad body Return Call NameLoad Dict Str Call NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword Str keyword Num orelse If Call NameLoad NameLoad NameLoad body Return Call NameLoad Dict Str Call NameLoad keyword Num keyword Call AttributeLoad Str attr AttributeLoad NameLoad attr keyword Str keyword Num orelse Expr Call AttributeLoad NameLoad attr Str Return Call NameLoad Dict Str Call NameLoad keyword Num keyword Call AttributeLoad Str attr AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad keyword Str keyword Num decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad Dict Str Str Str Str Num Call AttributeLoad Str attr AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad keyword Num Return NameLoad decorator_list Call AttributeLoad NameLoad attr Str keyword ListLoad Str Str Call NameLoad Str NameLoad FunctionDef arguments args NameParam defaults NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore Dict Assign TupleStore NameStore NameStore Call NameLoad Assign NameStore Dict Str Str Str NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Call NameLoad attr Str Dict Assign NameStore Num For NameStore Call AttributeLoad NameLoad attr Str TupleLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Dict Assign SubscriptStore NameLoad Index Str Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr If Call NameLoad NameLoad Str body Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index NameLoad NameLoad orelse Assign SubscriptStore NameLoad Index NameLoad Str Assign NameStore Num Return Call NameLoad NameLoad keyword NameLoad decorator_list Call AttributeLoad NameLoad attr Str Call NameLoad Str NameLoad FunctionDef arguments args NameParam defaults SubscriptLoad AttributeLoad NameLoad attr Slice Num body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr keyword NameLoad Expr Call NameLoad Expr Call AttributeLoad NameLoad attr keyword SubscriptLoad NameLoad Index Str keyword Call NameLoad SubscriptLoad NameLoad Index Str keyword Call NameLoad SubscriptLoad NameLoad Index Str decorator_list ClassDef bases body Expr Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad SubscriptLoad Call NameLoad Index Str attr Assign AttributeStore NameLoad attr SubscriptLoad Call NameLoad Index Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListComp Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str For NameStore NameLoad body If CompareEq Call AttributeLoad Call AttributeLoad NameLoad attr attr Str body Break TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam defaults SubscriptLoad AttributeLoad NameLoad attr Slice Num body Expr Str Expr Call NameLoad AttributeLoad NameLoad attr keyword NameLoad Expr Call NameLoad Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list
N/A N/A HTTP API implementation.
 N/A sys docopt docopt flask Flask flask make_response flask request N/A numpy np N/A ujson werkzeug.exceptions BadRequest N/A __version__ interfaces PredictError util args_from_config util get_config util get_metadata util initialize_config util logger util memory_usage_psutil util PluggableDecorator util process_store N/A app N/A Flask __name__ make_ujson_response N/A N/A obj status_code N/A 200 N/A N/A Encodes the given *obj* to json and wraps it in a response.

    :return:
      A Flask response.
     N/A json_encoded N/A N/A ujson encode obj ensure_ascii False double_precision -1 N/A resp N/A make_response json_encoded N/A N/A resp mimetype application/json N/A N/A resp content_type application/json; charset=utf-8 N/A N/A resp status_code status_code N/A resp N/A PredictService N/A N/A N/A A default :class:`palladium.interfaces.PredictService`
    implementation.

    Aims to work out of the box for the most standard use cases.
    Allows overriding of specific parts of its logic by using granular
    methods to compose the work.
     N/A types N/A float int str bool float int str N/A N/A N/A x N/A N/A N/A N/A x lower true __init__ N/A N/A self mapping params predict_proba N/A N/A False kwargs N/A N/A 
        :param mapping:
          A list of query parameters and their type that should be
          included in the request.  These will be processed in the
          :meth:`sample_from_data` method to construct a sample
          that can be used for prediction.  An example that expects
          two request parameters called ``pos`` and ``neg`` that are
          both of type str::

            { ...
              'mapping': [('pos', 'str'), ('neg', 'str')]
            ... }

        :param params:
          Similarly to *mapping*, this is a list of name and type of
          parameters that will be passed to the model's
          :meth:`~palladium.interfaces.Model.predict` method as keyword
          arguments.

        :param predict_proba:
          Instead of returning a single class (the default), when
          *predict_proba* is set to true, the result will instead
          contain a list of class probabilities.
         N/A N/A self mapping mapping N/A N/A self params params N/A N/A self predict_proba predict_proba N/A N/A N/A N/A vars self update kwargs N/A __call__ N/A N/A self model request N/A N/A N/A N/A N/A N/A N/A self do model request N/A N/A N/A Exception N/A e N/A N/A N/A N/A self response_from_exception e N/A do N/A N/A self model request N/A N/A N/A N/A N/A request method GET N/A N/A single True N/A samples N/A N/A np array N/A N/A N/A self sample_from_data model N/A request args N/A N/A single False N/A samples N/A N/A data N/A request json N/A N/A N/A N/A samples append N/A N/A self sample_from_data model data N/A samples N/A N/A np array samples N/A params N/A N/A self params_from_data model N/A request args N/A y_pred N/A N/A self predict model samples params N/A N/A N/A self response_from_prediction y_pred single single N/A sample_from_data N/A N/A self model data N/A N/A N/A Convert incoming sample *data* into a numpy array.

        :param model:
          The :class:`~Model` instance to use for making predictions.
        :param data:
          A dict-like with the sample's data, typically retrieved from
          ``request.args`` or similar.
         N/A values N/A N/A N/A key type_name N/A self mapping N/A N/A value_type N/A N/A self types N/A type_name N/A N/A N/A values append N/A value_type N/A data N/A key N/A N/A N/A np array values dtype object N/A params_from_data N/A N/A self model data N/A N/A N/A Retrieve additional parameters (keyword arguments) for
        ``model.predict`` from request *data*.

        :param model:
          The :class:`~Model` instance to use for making predictions.
        :param data:
          A dict-like with the parameter data, typically retrieved
          from ``request.args`` or similar.
         N/A params N/A N/A N/A key type_name N/A self params N/A N/A value_type N/A N/A self types N/A type_name N/A N/A key data N/A N/A N/A params N/A key N/A value_type N/A data N/A key N/A N/A N/A hasattr model key N/A N/A N/A params N/A key N/A getattr model key N/A params N/A predict N/A N/A self model sample N/A kwargs N/A N/A N/A self predict_proba N/A N/A N/A N/A model predict_proba sample kwargs N/A N/A N/A N/A model predict sample kwargs N/A response_from_prediction N/A N/A self y_pred single N/A True N/A N/A Turns a model's prediction in *y_pred* into a JSON
        response.
         N/A result N/A N/A y_pred tolist N/A single N/A N/A result N/A result N/A 0 N/A response N/A metadata result N/A get_metadata result N/A N/A make_ujson_response response status_code 200 N/A response_from_exception N/A N/A self exc N/A N/A N/A N/A isinstance exc PredictError N/A N/A N/A make_ujson_response N/A metadata N/A get_metadata error_code N/A exc error_code error_message N/A exc error_message status ERROR status_code 500 N/A N/A N/A isinstance exc BadRequest N/A N/A N/A make_ujson_response N/A metadata N/A get_metadata error_code -1 error_message N/A N/A BadRequest: {} format N/A exc args status ERROR status_code 400 N/A N/A N/A N/A logger exception Unexpected error N/A N/A make_ujson_response N/A metadata N/A get_metadata error_code -1 error_message N/A N/A {}: {} format N/A N/A exc __class__ __name__ N/A str exc status ERROR status_code 500 N/A N/A predict N/A N/A model_persister predict_service N/A N/A N/A N/A N/A model N/A N/A model_persister read N/A response N/A predict_service model request N/A N/A N/A Exception N/A exc N/A N/A N/A N/A logger exception Unexpected error N/A response N/A make_ujson_response N/A status error_code error_message ERROR -1 N/A N/A {}: {} format N/A N/A exc __class__ __name__ N/A str exc status_code 500 N/A response N/A N/A N/A app route /predict methods N/A GET POST N/A PluggableDecorator predict_decorators args_from_config alive N/A N/A alive N/A None N/A N/A N/A alive None N/A N/A alive N/A N/A N/A mem mem_vms N/A memory_usage_psutil N/A info N/A memory_usage memory_usage_vms palladium_version mem mem_vms __version__ N/A N/A info N/A service_metadata N/A N/A N/A get_config get service_metadata N/A N/A status_code 200 N/A attr N/A N/A alive get process_store_required N/A N/A N/A obj N/A N/A process_store get attr N/A N/A obj None N/A N/A obj_info N/A N/A N/A obj_info N/A updated N/A N/A N/A N/A process_store mtime N/A model isoformat N/A N/A hasattr obj __metadata__ N/A N/A N/A obj_info N/A metadata N/A obj __metadata__ N/A N/A info N/A attr obj_info N/A N/A N/A info N/A attr N/A N/A status_code 503 N/A N/A make_ujson_response info status_code status_code N/A N/A N/A app route /alive N/A PluggableDecorator alive_decorators args_from_config devserver_cmd N/A N/A argv N/A N/A N/A sys argv N/A 1 N/A N/A Serve the web API for development.

Usage:
  pld-devserver [options]

Options:
  -h --help               Show this screen.

  --host=<host>           The host to use [default: 0.0.0.0].

  --port=<port>           The port to use [default: 5000].

  --debug=<debug>         Whether or not to use debug mode [default: 0].
 N/A arguments N/A docopt N/A devserver_cmd __doc__ argv argv N/A N/A initialize_config N/A N/A N/A app run host N/A arguments N/A --host port N/A int N/A arguments N/A --port debug N/A int N/A arguments N/A --debug N/A PredictStream N/A N/A N/A A class that helps make predictions through stdin and stdout.
     __init__ N/A N/A self N/A N/A N/A N/A self model N/A N/A N/A N/A get_config N/A model_persister read N/A N/A self predict_service N/A N/A get_config N/A predict_service N/A process_line N/A N/A self line N/A N/A N/A predict_service N/A self predict_service N/A datas N/A N/A ujson loads line N/A samples N/A N/A N/A predict_service sample_from_data N/A self model data N/A data datas N/A samples N/A N/A np array samples N/A params N/A N/A predict_service params_from_data N/A self model N/A datas N/A 0 N/A N/A N/A predict_service predict N/A self model samples params N/A listen N/A N/A self io_in io_out io_err N/A N/A N/A Listens to provided io stream and writes predictions
        to output. In case of errors, the error stream will be used.
         N/A line io_in N/A N/A N/A N/A N/A N/A N/A line strip lower exit N/A N/A N/A N/A N/A y_pred N/A N/A self process_line line N/A N/A N/A Exception N/A e N/A N/A N/A N/A io_out write []
 N/A N/A N/A io_err write N/A N/A Error while processing input row: {}{}: {}
 format line N/A type e e N/A N/A N/A io_err flush N/A N/A N/A N/A io_out write N/A N/A ujson dumps N/A N/A y_pred tolist N/A N/A N/A io_out write N/A N/A N/A io_out flush N/A N/A stream_cmd N/A N/A argv N/A N/A N/A sys argv N/A 1 N/A N/A Start the streaming server, which listens to stdin, processes line
by line, and returns predictions.

The input should consist of a list of json objects, where each object
will result in a prediction.  Each line is processed in a batch.

Example input (must be on a single line):

  [{"sepal length": 1.0, "sepal width": 1.1, "petal length": 0.7,
    "petal width": 5}, {"sepal length": 1.0, "sepal width": 8.0,
    "petal length": 1.4, "petal width": 5}]

Example output:

  ["Iris-virginica","Iris-setosa"]

An input line with the word 'exit' will quit the streaming server.

Usage:
  pld-stream [options]

Options:
  -h --help                  Show this screen.
 N/A N/A docopt N/A stream_cmd __doc__ argv argv N/A N/A initialize_config N/A stream N/A PredictStream N/A N/A N/A stream listen N/A sys stdin N/A sys stdout N/A sys stderr N/A