diff options
Diffstat (limited to 'README.rst')
| -rw-r--r-- | README.rst | 39 |
1 files changed, 26 insertions, 13 deletions
@@ -14,6 +14,11 @@ The source code of this package is available on GitHub at: Installation ------------ +**Before** GenSVM can be installed, a working NumPy installation is required. +Please see `the installation instructions for NumPy +<https://docs.scipy.org/doc/numpy-1.13.0/user/install.html>`_, then install +GenSVM using the instructions below. + GenSVM can be easily installed through pip: .. code:: bash @@ -23,15 +28,15 @@ GenSVM can be easily installed through pip: Usage ----- -The package contains two classes to fit the GenSVM model: :class:`GenSVM` and -:class:`GenSVMGridSearchCV`. These classes respectively fit a single GenSVM -model or fit a series of models for a parameter grid search. The interface to -these classes is the same as that of classifiers in `Scikit-Learn <http://scikit-learn.org/stable/index.html>`_ so users -familiar with `Scikit-Learn <http://scikit-learn.org/stable/index.html>`_ should have no trouble using this package. Below +The package contains two classes to fit the GenSVM model: `GenSVM`_ and +`GenSVMGridSearchCV`_. These classes respectively fit a single GenSVM model +or fit a series of models for a parameter grid search. The interface to these +classes is the same as that of classifiers in `Scikit-Learn`_ so users +familiar with Scikit-Learn should have no trouble using this package. Below we will show some examples of using the GenSVM classifier and the GenSVMGridSearchCV class in practice. -In the examples We assume that we have loaded the `iris dataset +In the examples we assume that we have loaded the `iris dataset <http://scikit-learn.org/stable/auto_examples/datasets/plot_iris_dataset.html>`_ from Scikit-Learn as follows: @@ -53,7 +58,7 @@ computation time of GenSVM and is `generally recommended for SVMs Example 1: Fitting a single GenSVM model -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Let's start by fitting the most basic GenSVM model on the training data: @@ -121,7 +126,7 @@ For other parameters that can be tuned in the GenSVM model, see `GenSVM`_. Example 2: Fitting a GenSVM model with a "warm start" -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ One of the key features of the GenSVM classifier is that training can be accelerated by using so-called "warm-starts". This way the optimization can be @@ -170,7 +175,7 @@ can be used to do a grid search of parameters. Example 3: Running a GenSVM grid search -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Often when we're fitting a machine learning model such as GenSVM, we have to try several parameter configurations to figure out which one performs best on @@ -180,8 +185,7 @@ overfitting. To do this efficiently and to make use of warm starts, the `GenSVMGridSearchCV`_ class is available. This class works in the same way as the `GridSearchCV <http://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html>`_ -class of `Scikit-Learn <http://scikit-learn.org/stable/index.html>`_, but uses -the GenSVM C library for speed. +class of `Scikit-Learn`_, but uses the GenSVM C library for speed. To do a grid search, we first have to define the parameters that we want to vary and what values we want to try: @@ -216,8 +220,8 @@ found in the grid search: >>> gg.score(X_test, y_test) 1.0 -A nice feature borrowed from `Scikit-Learn <http://scikit-learn.org>`_ is that -the results from the grid search can be represented as a ``pandas`` DataFrame: +A nice feature borrowed from `Scikit-Learn`_ is that the results from the grid +search can be represented as a ``pandas`` DataFrame: .. code:: python @@ -262,6 +266,15 @@ License ------- This package is licensed under the GNU General Public License version 3. + Copyright G.J.J. van den Burg, excluding the sections of the code that are explicitly marked to come from Scikit-Learn. +.. _Scikit-Learn: + http://scikit-learn.org/stable/index.html + +.. _GenSVM: + https://gensvm.readthedocs.io/en/latest/#gensvm + +.. _GenSVMGridSearchCV: + https://gensvm.readthedocs.io/en/latest/#gensvmgridsearchcv |
