I am testing an SVM with a sigmoid kernel on the iris data. Its performance is extremely poor with an accuracy of 25 %. I'm using exactly the same code and normalizing the features as https://towardsdatascience.com/a-guide-to-svm-parameter-tuning-8bfe6b8a452c (sigmoid section) which should increase performance substantially. However, I am not able to reproduce his results and the accuracy only increases to 33 %.
Using other kernels (e.g linear kernel) produces good results (accuracy of 82 %).
Could there be an issue within the SVC(kernel = 'sigmoid') function?
The default value of the gamma parameter changed in version 0.22. The blog post you linked was written before 0.22 so gamma="auto" by default. You're on version 0.23.2 so ```gamma="scale"`` by default. Changing gamma to "auto" retreive the same scores as in the blog post. Besides if you want to tune the gamma parameter, you should do it by cross-validation, not just by looking for the best score on the training set.
Hi @marmor97 , it seems to me that your question was answered and you are happy with this answer... :)
I'm closing this issue. Feel free to reopen if you think something still need to be solved.
Describe the bug
I am testing an SVM with a sigmoid kernel on the iris data. Its performance is extremely poor with an accuracy of 25 %. I'm using exactly the same code and normalizing the features as https://towardsdatascience.com/a-guide-to-svm-parameter-tuning-8bfe6b8a452c (sigmoid section) which should increase performance substantially. However, I am not able to reproduce his results and the accuracy only increases to 33 %.
Using other kernels (e.g linear kernel) produces good results (accuracy of 82 %).
Could there be an issue within the SVC(kernel = 'sigmoid') function?
Steps/Code to Reproduce
Versions
System:
python: 3.8.6 (default, Oct 8 2020, 14:06:32) [Clang 12.0.0 (clang-1200.0.32.2)]
executable: /Users/Marie/Desktop/5 semester/Bachelor/Bachelor_vcode/hello/.venv/bin/python
machine: macOS-10.16-x86_64-i386-64bit
Python dependencies:
pip: 20.2.1
setuptools: 49.2.1
sklearn: 0.23.2
numpy: 1.19.2
scipy: 1.5.3
Cython: None
pandas: 1.1.3
matplotlib: 3.3.2
joblib: 0.17.0
threadpoolctl: 2.1.0
Built with OpenMP: True
The text was updated successfully, but these errors were encountered: