Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 870 Bytes

README.md

File metadata and controls

28 lines (18 loc) · 870 Bytes

coreml-scikit-example

Apple CoreML example with scikit-learn.

This is a simple example on how to export a Scikit-Learn model (logistic regression in this case) to the CoreML file, load it back and make predictions on it

On this really simple example it seems Apple's format is a bit lighter than a regular pickle:

677B iris.mlmodel
917B iris.pkl

Usage

It seeems that the coreml package only supports Python 2.7 for now

I recommend using a virtual env before installing pip requirements

pip install -r requirements.txt
python main.py

Disclaimer

The code should be a working example but it's not fully tested as prediction on CoreML models can only be done on macOS 10.13

The code should raise the following exception Exception: Model prediction is only supported on macOS version 10.13