Created
June 6, 2017 17:11
-
-
Save wrobstory/68e3660a7e84ebc397ce8c7e3e384e45 to your computer and use it in GitHub Desktop.
CoreML Serialization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [1]: %paste | |
from sklearn.datasets import load_iris | |
from sklearn import tree | |
import coremltools | |
iris = load_iris() | |
clf = tree.DecisionTreeClassifier() | |
clf = clf.fit(iris.data, iris.target) | |
## -- End pasted text -- | |
In [2]: coremltools.converters.sklearn.convert(clf) | |
Out[2]: | |
input { | |
name: "input" | |
type { | |
multiArrayType { | |
shape: 4 | |
} | |
} | |
} | |
output { | |
name: "classLabel" | |
type { | |
int64Type { | |
} | |
} | |
} | |
output { | |
name: "classProbability" | |
type { | |
dictionaryType { | |
int64KeyType { | |
} | |
} | |
} | |
} | |
predictedFeatureName: "classLabel" | |
predictedProbabilitiesName: "classProbability" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment