diff options
| -rw-r--r-- | CHANGELOG.rst | 2 | ||||
| -rw-r--r-- | docs/index.rst | 8 | ||||
| -rw-r--r-- | docs/kernels.rst | 22 | ||||
| -rw-r--r-- | gensvm/core.py | 15 |
4 files changed, 43 insertions, 4 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d4c9efb..aeaf650 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,7 +2,7 @@ Change Log ---------- Version 0.1.6 -~~~~~~~~~~~~~ +^^^^^^^^^^^^^ - Fix segfault caused by error function in C library. - Add "load_default_grid" function to gensvm.gridsearch diff --git a/docs/index.rst b/docs/index.rst index 7a28f0e..6064b56 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -20,4 +20,12 @@ GenSVMGridSearchCV .. include:: ./cls_gridsearch.rst +Functions +--------- + +.. autofunction:: gensvm.gridsearch.load_default_grid + +.. include:: ./kernels.rst + .. include:: ../CHANGELOG.rst + diff --git a/docs/kernels.rst b/docs/kernels.rst new file mode 100644 index 0000000..479b6c0 --- /dev/null +++ b/docs/kernels.rst @@ -0,0 +1,22 @@ +Kernels in GenSVM +----------------- + +Kernels in GenSVM are implemented as follows. + +- Radial Basis Function (RBF): + +.. math:: + + k(x_1, x_2) = \exp(-\gamma \| x_1 - x_2 \|^2 ) + +- Polynomial: + +.. math:: + + k(x_1, x_2) = (\gamma x_1'x_2 + coef)^{degree} + +- Sigmoid: + +.. math:: + + k(x_1, x_2) = \tanh(\gamma x_1'x_2 + coef) diff --git a/gensvm/core.py b/gensvm/core.py index 2776ec6..9b7d093 100644 --- a/gensvm/core.py +++ b/gensvm/core.py @@ -88,13 +88,18 @@ class GenSVM(BaseEstimator, ClassifierMixin): gamma : float, optional (default='auto') Kernel parameter for the rbf, poly, and sigmoid kernel. If gamma is - 'auto' then 1/n_features will be used. + 'auto' then 1/n_features will be used. See `gensvm_kernels`_ for the + exact implementation of the kernels. coef : float, optional (default=0.0) - Kernel parameter for the poly and sigmoid kernel + Kernel parameter for the poly and sigmoid kernel. See `gensvm_kernels`_ + for the exact implementation of the kernels. + degree : float, optional (default=2.0) - Kernel parameter for the poly kernel + Kernel parameter for the poly kernel. See `gensvm_kernels`_ for the + exact implementation of the kernels. + kernel_eigen_cutoff : float, optional (default=1e-8) Cutoff point for the reduced eigendecomposition used with @@ -132,6 +137,10 @@ class GenSVM(BaseEstimator, ClassifierMixin): :class:`.GenSVMGridSearchCV`: Helper class to run an efficient grid search for GenSVM. + + .. _gensvm_kernels: + https://gensvm.readthedocs.io/en/latest/#kernels-in-gensvm + """ def __init__(self, p=1.0, lmd=1e-5, kappa=0.0, epsilon=1e-6, |
