Files
zeekay 9546c92611 Replace placeholders with real working examples
ML examples:
- credit_scoring: Credit risk prediction with HMEQ data
- disease_prediction: Healthcare ML on encrypted records
- cifar: Encrypted image classification
- federated_learning: Distributed FHE training
- hybrid_model: Mixed FHE/plaintext inference

Deployment:
- breast_cancer: Cancer detection API
- sentiment_analysis: Encrypted NLP
- server: FHE inference server

Blockchain:
- hardhat-template: Solidity + FHE
- react-template: Full dApp with FHE
2026-01-25 20:46:26 -08:00

24 lines
707 B
Python

import numpy
from sklearn.datasets import load_breast_cancer
from concrete.ml.deployment import FHEModelClient, FHEModelDev, FHEModelServer
from concrete.ml.sklearn import XGBClassifier
if __name__ == "__main__":
# First get some data and train a model.
X, y = load_breast_cancer(return_X_y=True)
assert isinstance(X, numpy.ndarray)
assert isinstance(y, numpy.ndarray)
# Split X into X_model_owner and X_client
X_train = X[:-10]
y_train = y[:-10]
# Train the model and compile it
model = XGBClassifier(n_bits=2, n_estimators=8, max_depth=3)
model.fit(X_train, y_train)
model.compile(X_train)
dev = FHEModelDev("./dev", model)
dev.save(via_mlir=True)