Converts a logistic regression into C

The logistic regression is trained in python and executed in C.

Train a linear regression

Export into C

We can even check what the function should produce as a score. Types are strict.

We compare with scikit-learn.

Conversion into C:

We execute the code with module cffi.

Time comparison

There is a significant speedup on this example. It could be even faster by removing some Python part and optimizing the code produced by cffi. We can also save the creation of the array which contains the output by reusing an existing one.