Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
bob.learn.libsvm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bob
bob.learn.libsvm
Commits
0b720f7f
Commit
0b720f7f
authored
Nov 13, 2015
by
Artur Costa Pazo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error on OC-SVM documentation example code on py 3.x caused by reused variables.
parent
4607ce8d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
doc/guide.rst
doc/guide.rst
+10
-10
No files found.
doc/guide.rst
View file @
0b720f7f
...
...
@@ -161,8 +161,8 @@ On the other hand, the package allows you to train a One Class Support Vector Ma
:options: +NORMALIZE_WHITESPACE
>>> oc_pos = 0.4 * numpy.random.randn(100, 2).astype(numpy.float64)
>>> data = [oc_pos]
>>> print(data) # doctest: +SKIP
>>>
oc_
data = [oc_pos]
>>> print(
oc_
data) # doctest: +SKIP
As the above example, an SVM [1]_ for one class problem can be trained easily using the
...
...
@@ -171,20 +171,20 @@ As the above example, an SVM [1]_ for one class problem can be trained easily us
.. doctest::
:options: +NORMALIZE_WHITESPACE
>>> trainer = bob.learn.libsvm.Trainer(machine_type='ONE_CLASS')
>>>
machine = trainer.train(
data)
>>>
oc_
trainer = bob.learn.libsvm.Trainer(machine_type='ONE_CLASS')
>>>
oc_machine = oc_trainer.train(oc_
data)
Then, as explained before, a :py:class:`bob.learn.libsvm.Machine` can be used for classify the new entries.
.. doctest::
:options: +NORMALIZE_WHITESPACE
>>> test = 0.4 * numpy.random.randn(20, 2).astype(numpy.float64)
>>> outliers = numpy.random.uniform(low=-4, high=4, size=(20, 2)).astype(numpy.float64)
>>> predicted_label_
test = machine(
test)
>>> predicted_label_o
utliers = machine(
outliers)
>>> print(predicted_label_test) # doctest: +SKIP
>>> print(predicted_label_outliers) # doctest: +SKIP
>>>
oc_
test = 0.4 * numpy.random.randn(20, 2).astype(numpy.float64)
>>> o
c_o
utliers = numpy.random.uniform(low=-4, high=4, size=(20, 2)).astype(numpy.float64)
>>> predicted_label_
oc_test = oc_machine(oc_
test)
>>> predicted_label_o
c_outliers = oc_machine(oc_
outliers)
>>> print(predicted_label_
oc_
test) # doctest: +SKIP
>>> print(predicted_label_o
c_o
utliers) # doctest: +SKIP
Acknowledgements
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment