Skip to content

Instantly share code, notes, and snippets.

@darcwader
Created October 29, 2017 13:43
Show Gist options
  • Select an option

  • Save darcwader/c5c3f69eb2f1c215edd8ced21997b9aa to your computer and use it in GitHub Desktop.

Select an option

Save darcwader/c5c3f69eb2f1c215edd8ced21997b9aa to your computer and use it in GitHub Desktop.
spam
import coremltools
coreml_model = coremltools.converters.sklearn.convert(spam_detector, "message", "spam_or_not")
#set parameters of the model
coreml_model.short_description = "Classify whether message is spam or not"
coreml_model.input_description["message"] = "TFIDF of message to be classified"
coreml_model.output_description["spam_or_not"] = "Whether message is spam or not"
#save the model
coreml_model.save("SpamMessageClassifier.mlmodel")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment