nfmcclure / tensorflow_cookbook

Code for Tensorflow Machine Learning Cookbook

Home Page:https://www.packtpub.com/big-data-and-business-intelligence/tensorflow-machine-learning-cookbook-second-edition

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to control softmargin in Nonlineanr_svm model

hunterzju opened this issue · comments

new issues related to #95
Dear Nick:
Thank you very much for your reply, but still I want to know if it is possible to control the softmargin in the Nonlineanr_svm. Because I did not find a constant named 'alpha' in the Nonlineanr_svm.py. Or can you tell me the paper or documents your code based on?

commented

Hi @hunterzju ,
The softmargin parameter for the gaussian kernel is not explicit. Instead, you change the parameter 'gamma'. The larger the gamma value (more negative in the code), the closer the border gets to clusters of one class versus the other. To illustrate this, try changing the gamma value to:
gamma = tf.constant(-50.0)
and
gamma = tf.constant(-0.5)

Good luck, and let me know if this doesn't work for you.

I understand, thanks a lot!