LibSVM

coremltools.converters.libsvm._libsvm_converter.convert(libsvm_model, feature_names, target, input_length, probability)[source]

Convert a support vector machine (SVM) model to the protobuf spec.

Supports:
  • C-SVC

  • nu-SVC

  • Epsilon-SVR

  • nu-SVR

Parameters:
model_path: libsvm_model

Libsvm representation of the model.

feature_names[str] | str

Names of each of the features.

target: str

Name of the predicted class column.

probability: str

Name of the class probability column. Only used for C-SVC and nu-SVC.

Returns:
model_spec: An object of type Model_pb.

Protobuf representation of the model