Takes an SVM classifier produces a starting spec using the parts.  that are
    shared between all SVMs.

def _generate_base_svm_classifier_spec(model):
    """
    Takes an SVM classifier produces a starting spec using the parts.  that are
    shared between all SVMs.
    """
    if not(_HAS_SKLEARN):
        raise RuntimeError('scikit-learn not found. scikit-learn conversion API is disabled.')

    check_fitted(model, lambda m: hasattr(m, 'support_vectors_'))

    spec = _Model_pb2.Model()
    spec.specificationVersion = SPECIFICATION_VERSION
    svm = spec.supportVectorClassifier

    _set_kernel(model, svm)

    for cur_rho in model.intercept_:
        if(len(model.classes_) == 2):
            # For some reason Scikit Learn doesn't negate for binary classification
            svm.rho.append(cur_rho)
        else:
            svm.rho.append(-cur_rho)

    for i in range(len(model._dual_coef_)):
        svm.coefficients.add()
        for cur_alpha in model._dual_coef_[i]:
            svm.coefficients[i].alpha.append(cur_alpha)

    for cur_src_vector in model.support_vectors_:
        cur_dest_vector = svm.denseSupportVectors.vectors.add()
        for i in cur_src_vector:
            cur_dest_vector.values.append(i)
    return spec