# ZK-Cook

This package is designed to provide functionality that facilitates the transition from ML algorithms to ZKML. Its two main functionalities are:

**Serialization**: saving a trained ML model in a specific format to be interpretable by other programs.**model-complexity-reducer (mcr)**: Given a model and a training dataset, transform the model and the data to obtain a lighter representation that maximizes the tradeoff between performance and complexity.

It's important to note that although the main goal is the transition from ML to ZKML, mcr can be useful in other contexts, such as:

The model's weight needs to be minimal, for example for mobile applications.

Minimal inference times are required for low latency applications.

We want to check if we have created an overly complex model and a simpler one would give us the same performance (or even better).

The number of steps required to perform the inference must be less than X (as is currently constrained by the ZKML paradigm).

## Installation

## Serialization

To see in more detail how this tool works, check out this tutorial.

To run it:

This serialised model can then be sent directly to transpile using our platform. If the model is too large, it will have to be reduced using **MCR**, but the structure is already understandable by our transpiler.

## MCR

To see in more detail how this tool works, check out this tutorial.

To see in more technical detail the algorithm behind this method, check out our paper.

To run it:

### Supported models

Model | status |
---|---|

XGBRegressor | ✅ |

XGBClassifier | ✅ |

LGBMRegressor | ✅ |

LGBMClassifier | ✅ |

Logistic Regression | ⏳ |

GARCH | ⏳ |

Last updated