Skip to content

Commit

Permalink
chore: training example
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-stoian-zama committed Jun 19, 2024
1 parent 899e2ba commit 5ea05a9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 9 additions & 3 deletions docs/built-in-models/linear.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Linear models

This document introduces some [scikit-learn](https://scikit-learn.org/stable/)'s linear models for `regression` and `classification` that Concrete ML provides.
This page explains Concrete ML linear models for both classification and regression. These models are based on [scikit-learn](https://scikit-learn.org/stable/) linear models.

## Supported models
## Supported models for encrypted inference

The use of the following models in FHE is very similar to the use of scikit-learn's [API](https://scikit-learn.org/stable/modules/classes.html#module-sklearn.linear_model). They are also compatible with some of scikit-learn's main workflows, such as `Pipeline()` and `GridSearch()`.
The following models are supported for training on clear data and predicting on encrypted data. Their API is similar the one of [scikit-learn](https://scikit-learn.org/stable/modules/classes.html#module-sklearn.linear_model). These models are also compatible with some of scikit-learn's main workflows, such as `Pipeline()` and `GridSearch()`.

| Concrete ML | scikit-learn |
| :--------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------: |
Expand All @@ -20,6 +20,12 @@ The use of the following models in FHE is very similar to the use of scikit-lear
| [ElasticNet](../references/api/concrete.ml.sklearn.linear_model.md#class-elasticnet) | [ElasticNet](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.ElasticNet.html#sklearn.linear_model.ElasticNet) |
| [SGDRegressor](../references/api/concrete.ml.sklearn.linear_model.md#class-sgdregressor) | [SGDRegressor](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.SGDRegressor.html) |

## Supported models for encrypted training

In addition to predicting on encrypted data, the following models support training on encrypted data.

| [SGDClassifier](../references/api/concrete.ml.sklearn.linear_model.md#class-sgdclassifier) | [SGDClassifier](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.SGDRegressor.html) |

## Quantization parameters

The `n_bits` parameter controls the bit-width of the inputs and weights of the linear models. Linear models do not use table lookups and thus alllows weight and inputs to be high precision integers.
Expand Down
6 changes: 6 additions & 0 deletions docs/tutorials/ml_examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,9 @@ Two different configurations of the built-in, fully-connected neural networks ar
- [Regressor comparison](../advanced_examples/RegressorComparison.ipynb)

Based on three different synthetic data-sets, all the built-in classifiers are demonstrated in this notebook, showing accuracies, inference times, accumulator bit-widths, and decision boundaries.

### 7. Training on encrypted data

- [LogisticRegression training](../advanced_examples/LogisticRegressionTraining.ipynb)

This example shows how to configure a training algorithm that works on encrypted data and how to deploy it in a client/server application.

0 comments on commit 5ea05a9

Please sign in to comment.