Skip to content

The --double flag is not propagated by the scikit-learn Pipeline class #18

@mbarbetti

Description

@mbarbetti

Using something like the following lines to convert preprocessing and ANN models to C

import pickle
import scikinC
from tensorflow import keras
from sklearn.pipeline import Pipeline

with open("/path/to/tX.pkl", "rb") as file:
  x_scaler = pickle.load(file)  # for example, a sklearn QuantileTransformer

model = keras.models.load_model("/path/to/saved_model")

pipe = Pipeline([("tX", x_scaler), ("dnn", model)])

deploy = {"pipe": pipe}
c_fname = "pipe.C"
print(scikinC.convert(deploy, float_t="double"), file=open(f"/path/to/{c_fname}", "w"))

prevents the conversion of the sklearn x_scaler and keras model to receive correctly the --double flag passed to scikinC.
The flag is used as expected only by the sklearn pipe.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions