1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
"""
A Support Vector Machine, this module defines the following classes:
- `LibSvmCClassificationModel`, a model for C-SV classification
- `LibSvmNuClassificationModel`, a model for nu-SV classification
- `LibSvmEpsilonRegressionModel`, a model for epsilon-SV regression
- `LibSvmNuRegressionModel`, a model for nu-SV regression
- `LibSvmOneClassModel`, a model for distribution estimation
(one-class SVM)
Kernel classes:
- `LinearKernel`, a linear kernel
- `PolynomialKernel`, a polynomial kernel
- `RBFKernel`, a radial basis function kernel
- `SigmoidKernel`, a sigmoid kernel
- `CustomKernel`, a kernel that wraps any callable
Dataset classes:
- `LibSvmClassificationDataSet`, a dataset for training classification
models
- `LibSvmRegressionDataSet`, a dataset for training regression models
- `LibSvmOneClassDataSet`, a dataset for training distribution
estimation (one-class SVM) models
- `LibSvmTestDataSet`, a dataset for testing with any model
Data type classes:
- `svm_node_dtype`, the libsvm data type for its arrays
How To Use This Module
======================
(See the individual classes, methods, and attributes for details.)
1. Import it: ``import svm`` or ``from svm import ...``.
2. Create a training dataset for your problem::
traindata = LibSvmClassificationDataSet(labels, x)
traindata = LibSvmRegressionDataSet(y, x)
traindata = LibSvmOneClassDataSet(x)
where x is sequence of NumPy arrays containing scalars or
svm_node_dtype entries.
3. Create a test dataset::
testdata = LibSvmTestDataSet(u)
4. Create a model and fit it to the training data::
model = LibSvmCClassificationModel(kernel)
results = model.fit(traindata)
5. Use the results to make predictions with the test data::
p = results.predict(testdata)
v = results.predict_values(testdata)
"""
raise ImportError(
"""svm has been moved to scikits. Please install
scikits.learn instead, and change your import to the following:
from scikits.learn.machine import svm
For informations about scikits, see:
http://projects.scipy.org/scipy/scikits/""")
from classification import *
from regression import *
from oneclass import *
from dataset import *
from kernel import *
from predict import *
|