Issue with Compatibility of Concrete ML

Hi everyone,

I am facing an issue with Concrete ML when trying to convert a machine learning model that uses the RandomForestClassifier from scikit-learn. The model conversion process results in the following error message: :upside_down_face:

Error: Unsupported algorithm or invalid parameters for conversion.

my setup details -

Concrete ML version: 3.x (latest version)

scikit-learn version: 1.2.3

Python version: 3.9.7

Model code snippet:

from sklearn.ensemble import RandomForestClassifier

from concrete.ml.sklearn import convert

Define and train the model

model = RandomForestClassifier(n_estimators=100, max_depth=10)

model.fit(X_train, y_train)

Attempt to convert the model

concrete_model = convert(model)

I have verified that both Concrete ML and scikit-learn are up to date. Iā€™m particularly interested in any known limitations or recommended workarounds for using RandomForestClassifier with Concrete ML.

Has anyone else faced this issue ; have suggestions on how to address it? Any guidance ; advice would be greatly appreciated.

Thanks in advance for your help!

Best regards, :slightly_smiling_face:

Could you post the output of pip freeze | grep concrete please ? The latest Concrete ML is 1.6

Could you also post the definition of the convert function?

Hey

Maybe what you want to do is simply to import RandomForestClassifier from concrete.ml.sklearn, instead of from sklearn?

Look at eg GitHub - zama-ai/concrete-ml: Concrete ML: Privacy Preserving ML framework using Fully Homomorphic Encryption (FHE), built on top of Concrete, with bindings to traditional ML frameworks., you have to change your imports, to be in FHE. And then, you will call the compile function to make the conversion.

Cheers