semvec/pypi-packages huggingface dataset:
waylay-ml-adapter-sklearn 0.1.1
ML_adapter for sklearn.
Requires Python: >=3.11

# waylay-ml-adapter-sklearn

Provides the `waylay-ml-adapter-sklearn` module as 
[Waylay ML Adapter](https://docs.waylay.io/#/api/sdk/python?id=ml_adapter) for [scikit-learn](https://scikit-learn.org/stable/).

## Installation
```
pip install waylay-ml-adapter-sklearn
```


## Classes exported by `ml_adapter.sklearn`

The module `ml_adapter.sklearn` exports the following classes
    
### `V1SklearnPredictAdapter`
`ml_adapter.sklearn.V1SklearnPredictAdapter` extending `ml_adapter.numpy.adapter.V1NumpyModelAdapter`
> ModelAdapter for sklearn models with a `predict` method.


### `V1SklearnPredictProbaAdapter`
`ml_adapter.sklearn.V1SklearnPredictProbaAdapter` extending `ml_adapter.numpy.adapter.V1NumpyModelAdapter`
> ModelAdapter for sklearn models with a `predict_proba` method.



## See also

* [waylay-ml-adapter-numpy](https://pypi.org/project/waylay-ml-adapter-numpy/) the [numpy](https://numpy.org/) data adapter that this model adapter uses.
* [waylay-ml-adapter-torch](https://pypi.org/project/waylay-ml-adapter-torch/) _ML adapter_ for [pytorch](https://pytorch.org/) models.
* [waylay-ml-adapter-sdk](https://pypi.org/project/waylay-ml-adapter-sdk/) provides the `ml_tool` extension to the [waylay-sdk](https://pypi.org/project/waylay-sdk/)
* [waylay-ml-adapter-base](https://pypi.org/project/waylay-ml-adapter-base/) provides the basic _ML adapter_ infrastructure.
* [waylay-ml-adapter-api](https://pypi.org/project/waylay-ml-adapter-api/) defines the remote data interfaces.
waylay-ml-adapter-sdk 0.1.1
ML_adapter plugin for waylay-sdk-py.
Requires Python: >=3.11

# waylay-ml-adapter-sdk

ML Model Adapter plugin for [waylay-sdk](https://pypi.org/project/waylay-sdk/).

## Installation

```
# installs the ml tool, and the required sdk modules:
pip install waylay-ml-adapter-sdk

# install the adapter module you need:
pip install waylay-ml-adapter-sklearn[dill]
```


## Classes exported by `ml_adapter.sdk`

The module `ml_adapter.sdk` exports the following classes
    
### `MLTool`
`ml_adapter.sdk.tool.MLTool`
> MLAdapter utility service for the waylay client.

Helps creating waylay webscripts and plugs that wrap a machine learning model.

Loaded as tool with name `ml_tool` in the python sdk.

#### Example
```python
# create and test a simple model
import numpy as np
test_data = [1,2,3]
expected_result = [2,4,6]
doubler = lambda x: x*2
assert np.array_equal(
    np.array(expected_result),
    doubler(np.array(test_data))
)

# wrap in an adapter, test remoting
from ml_adapter.numpy import V1NumpyModelAdapter
adapter=V1NumpyModelAdapter(model=doubler)
test_resp == await adapter.call({"instances": test_data.tolist()})
assert test_resp['predictions'] = expected_result.tolist()

# use the ml_tool to deploy and test a webscript
# configure logging to see what is happening
import logging
logging.basicConfig(level='INFO')
from waylay.sdk import WaylayClient
client = WaylayClient.from_profile('demo')

ref = await client.ml_tool.create_webscript(
    adapter, name='MyMLWebscript', draft=True
)
ref = await client.ml_tool.wait_until_ready(ref)
result = await client.ml_tool.test_webscript(ref, test_data)
if expected_result.to_list() == result:
    await client.ml_tool.publish(ref)
else:
    await client.ml_tool.remove(ref)
```




## See also

* [waylay-sdk](https://pypi.org/project/waylay-sdk/) the Waylay python SDK.
* [waylay-ml-adapter-sklearn](https://pypi.org/project/waylay-ml-adapter-sklearn/) _ML adapter_ for [scikit-learn](https://scikit-learn.org/stable/) models.
* [waylay-ml-adapter-torch](https://pypi.org/project/waylay-ml-adapter-torch/) _ML adapter_ for [pytorch](https://pytorch.org/) models.
* [waylay-ml-adapter-base](https://pypi.org/project/waylay-ml-adapter-base/) provides the basic  _ML adapter_ infrastructure.
* [waylay-ml-adapter-api](https://pypi.org/project/waylay-ml-adapter-api/) defines the remote data interfaces.
waylay-ml-adapter-numpy 0.1.1
ML_adapter for numpy.
Requires Python: >=3.11

# waylay-ml-adapter-numpy

This provides the `ml_adapter.numpy` module as [Waylay ML Adapter](https://docs.waylay.io/#/api/sdk/python?id=ml_adapter) for models that use numpy as data representation.

This `waylay-ml-adapter-numpy` module provides marshalling for (custom) models that use [numpy](https://numpy.org/) as native data representation.

```
pip install waylay-ml-adapter-numpy
```

## Exported classes

This module exports the following classes:


## Classes exported by `ml_adapter.numpy`

The module `ml_adapter.numpy` exports the following classes
    
### `V1NumpyModelAdapter`
`ml_adapter.numpy.adapter.V1NumpyModelAdapter` extending `ml_adapter.base.adapter.ModelAdapterBase`
> Adapts a callable with numpy arrays as input and output.

Supports dill, joblib or selfserializing model assets.



### `V1NumpyMarshaller`
`ml_adapter.numpy.marshall.V1NumpyMarshaller` extending `ml_adapter.base.marshall.v1.base.V1ValueOrDictRequestMarshallerBase`, `ml_adapter.base.marshall.v1.base.V1ValueOrDictResponseMarshallerBase`, `ml_adapter.numpy.marshall.V1NumpyEncoding`
> Converts v1 payload from and to numpy arrays.


### `V1NumpyNoLoadAdapter`
`ml_adapter.numpy.adapter.V1NumpyNoLoadAdapter` extending `ml_adapter.numpy.adapter.V1NumpyModelAdapter`
> Adapts a callable with numpy arrays as input and output.

This adapter does not manage the model as a standard asset.
Relies on the `model` or `model_class` constructor arguments
to define the model.
When `model` is not provided, any `model_path` is passed as a constructor
argument to `model_class` if the signature allows it.
waylay-ml-adapter-api 0.1.1
API models for the ml-adapter.
Requires Python: >=3.11

# waylay-ml-adapter-api

Provides the `ml_adapter.api` module for the [Waylay ML Adapter](https://docs.waylay.io/#/api/sdk/python?id=ml_adapter) solution.

This module is not meant to be used on its own.

To use an _ML Adapter_ in a Waylay _plugin_ or _webscript_, use the adapter relevant to your machine learning framework:
* [waylay-ml-adapter-numpy](https://pypi.org/project/waylay-ml-adapter-numpy/) for generic models that use [numpy](https://numpy.org/) data representation
* [waylay-ml-adapter-sklearn](https://pypi.org/project/waylay-ml-adapter-sklearn/) for [scikit-learn](https://scikit-learn.org/stable/) models.
* [waylay-ml-adapter-torch](https://pypi.org/project/waylay-ml-adapter-torch/) for [pytorch](https://pytorch.org/) models.

The [waylay-ml-adapter-base](https://pypi.org/project/waylay-ml-adapter-base/) module provides a basis to create adapters for other frameworks.

The [waylay-ml-adapter-sdk](https://pypi.org/project/waylay-ml-adapter-sdk/) module provides the `ml_tool` extension
to the [waylay-sdk](https://pypi.org/project/waylay-sdk/) SDK.
It helps to create and test adapters from e.g. a python notebook.


## Classes exported by `ml_adapter.api`

The module `ml_adapter.api` exports the following classes
    
### `v1`
> V1 Dataplane protocol for ML services.

See
 * [KServe V1](https://kserve.github.io/website/master/modelserving/data_plane/v1_protocol/)
 * [Tensorflow V1](https://www.tensorflow.org/tfx/serving/api_rest#predict_api)



### `v2`
> V2 Dataplane protocol for ML services.

See
 * [Open Inference Protocol](
https://github.com/kserve/open-inference-protocol/tree/main
   )