retsreg
retsreg

Reputation: 11

accuracy metric in optunity returns all zeros?

I'm using scikit on Ubuntu. I was able to get this SVM classification example running:

http://optunity.readthedocs.io/en/latest/notebooks/notebooks/sklearn-svc.html#tune-svc-without-deciding-the-kernel-in-advance

This returns the roc_auc metric, and I'm interested in accuracy. Just to test it, I tried replacing:

return optunity.metrics.roc_auc(y_test, decision_values)

with:

return optunity.metrics.accuracy(y_test, decision_values)

In the function below:

def svm_tuned_auroc(x_train, y_train, x_test, y_test, kernel='linear', C=0, logGamma=0, degree=0, coef0=0):
    model = train_model(x_train, y_train, kernel, C, logGamma, degree, coef0)
    decision_values = model.decision_function(x_test)
    return optunity.metrics.roc_auc(y_test, decision_values)

But unexpectedly, the accuracy metric is 0 for all parameter combinations. I'm sure I'm just doing something wrong ... a working example would be helpful!

Upvotes: 1

Views: 51

Answers (0)

Related Questions