1
votes

I tried creating a SVM Classifier, as:

# Create a SVM Classifier
model = SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0,
            decision_function_shape=None, degree=3, gamma='auto', kernel='linear',
            max_iter=-1, probability=True, random_state=None, shrinking=True,
            tol=0.001, verbose=False
            )

(Using Python 2.7)

But getting this error--

TypeError: init() got an unexpected keyword argument 'decision_function_shape'

Any thoughts on that will be very useful. Cheers!

1
You could simply leave it out because you're using None, which is the default - AndyG
Which version of sklearn do you have installed? It looks like the decision_function_shape argument was only added in versions 0.17+. for example here's the documentation from 0.16 which lacks that argument. - Cory Kramer
It's 0.16.1. I tried to install the update but it's kept on saying- No matching distribution found for the upgrade. - Abhishek Jaiswal

1 Answers

2
votes

I did upgrade my sklearn to version 0.18. Earlier it was 0.16.1 and as @coryKramer suggested-- decision_function_shape argument was only added in versions 0.17+.

So I followed his suggestion and upgraded and now everything is working just fine.

Meanwhile, here's how to upgrade from cmd in Windows, using pip.

pip install scikit-learn==0.18 --force-reinstall