-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[MRG+1] Support Vector Data Description #7910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
I tried twice to correct the E402 ( I just do not know where to move the imports. Besides in the |
doc/modules/outlier_detection.rst
Outdated
@@ -302,3 +318,25 @@ multiple modes and :class:`ensemble.IsolationForest` and | |||
an outlier detection method), the :class:`ensemble.IsolationForest`, | |||
the :class:`neighbors.LocalOutlierFactor` | |||
and a covariance-based outlier detection :class:`covariance.EllipticEnvelope`. | |||
|
|||
One-class SVM versus SVDD-L1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One-Class
is used in the rest of the docs instead of One-class
, perhaps you should change to maintain consistency?
doc/modules/outlier_detection.rst
Outdated
One-class SVM versus SVDD-L1 | ||
---------------------------- | ||
|
||
The One-class SVM and SVDD models though apparently different both try to construct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
models though apparently different both
, models, though apparently different, both
Move |
I decided to change the parametrization of the SVDD from
|
It seems that the CircleCI has failed due to reasons unrelated to the latest updates of the PR. The last log message is: `$ /home/ubuntu/miniconda/bin/conda create -n testenv --yes --quiet python numpy scipy cython nose coverage matplotlib sphinx pillow`
Traceback (most recent call last):
File "/home/ubuntu/miniconda/lib/python2.7/site-packages/conda/exceptions.py", line 479, in conda_exception_handler
return_value = func(*args, **kwargs)
File "/home/ubuntu/miniconda/lib/python2.7/site-packages/conda/cli/main.py", line 145, in _main
exit_code = args.func(args, p)
File "/home/ubuntu/miniconda/lib/python2.7/site-packages/conda/cli/main_create.py", line 68, in execute
install(args, parser, 'create')
File "/home/ubuntu/miniconda/lib/python2.7/site-packages/conda/cli/install.py", line 420, in install
raise CondaRuntimeError('RuntimeError: %s' % e)
CondaRuntimeError: Runtime error: RuntimeError: Runtime error: HTTPError: 530 Server Error: for url: https://repo.continuum.io/pkgs/free/linux-64/sphinx-1.4.8-py27_0.tar.bz2: https://repo.continuum.io/pkgs/free/linux-64/sphinx-1.4.8-py27_0.tar.bz2 Maybe the test should be rerun. |
For some reason Travis and AppVeyor haven't run, so maybe try |
These checks didn't run probably due to the explicit |
These checks didn't run probably due to the explicit [ci skip] flag in
the commit message. I put that in the message, because the commit
contained a minor edit in the documentation.
I rerun circle, and it finished alright.
|
Fair enough, I did not know about this feature. I am not sure I would encourage this to be honest, because when the status comes back green, it's easy to miss that only part of the CIs did run. |
A third party suggested that I rebased the commits in my branch to keep it up to date. I did so a couple of hours ago, but only now noticed that it botched the branch by pulling some commits from the master and duplicating all my commits atop. Do you have any suggestions on how to fix his, or do i have to initiate a new pr altogether? |
You should be fine without a new PR. Probably easiest is |
doc/modules/outlier_detection.rst
Outdated
One-Class SVM versus SVDD-L1 | ||
---------------------------- | ||
|
||
The One-Class SVM and SVDD models, though apparently different, both try to construct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a very clear description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This subsection is just an illustration of the difference between the models. The actual description is in modules/svm.rst
. I will add references to the detailed descriptions.
I have given the SVDD libsvm code another thorough check and updated its description as well as the comparison to the One-Class SVM. |
Sorry for the long delay with implementing unit tests for this feature. I added the following tests to
Excerpts from current master
svdd_l1 branch
|
As usual, all tests ran successfully except for Travis. Besides the usual At the first glance there should be no error since kf_iter = KFold(n_splits=5).split(X, y)
kf_iter_wrapped = check_cv(kf_iter)
print list(kf_iter_wrapped.split(X, y))
print list(kf_iter_wrapped.split(X, y)) prints identical CV split lists (as it should)
@lesteve, do you have any suggestions? |
Don't worry about the test failing that is not related to your PR. Actually it is the numpy-dev and it is allowed to fail so it will not influence the green or red status of your PR. For the record I can reproduce it locally with numpy from master so I'll investigate. |
@nelson-liu , @amueller , do you have any remarks/suggestions regarding the description of the One-Class SVM and the SVDD? |
I rebased the branch to keep it up to date with the master. |
Travis is failing because of pep8. |
I improved the documentation of the SVDD and the One-Class SVM and added a sparse Should I resolve the |
AppVeyor tests exited with code Update:
|
@ivannz the test failure in logistic was fixed in master in the meantime. I'm not sure how we are handling the |
I think recently we might just have not used the |
…ple is never a support vector
see-also cross-reference in ocSVM and SVDD (reflecting scikit-learn#18332)
ensure SVDD passes numpydoc validation (scikit-learn#20463) check for svdd in `test_sparse.py:check_svm_model_equal` to avoid calling `.predict_proba`
…_new add backticks (scikit-learn#20914), deprecate **params in fit (scikit-learn#20843), add feature_names_in_ (scikit-learn#20787) uncompromisingly reformat plot_oneclass_vs_svdd with black
…from ocSVM, and bumped versionadded; added SVDD to tests which involved ocSVM
…cSVM scikit-learn#24001) finish v1.2 deprecation of params kwargs in `.fit` of SVDD (similar to ocSVM scikit-learn#20843) TST ensure SVDD passes param-validation test_common.py due to scikit-learn#23462 (scikit-learn#22722)
add SVDD announcement to svm.cpp, fix stray trailing spaces (#r374671161)
Thank you @cmarmo , for pointing out these unresolved comments! I have gone though the thread once more and compiled a summary of the key issues, comments and requests (the simplest of them have been addressed):
|
Thanks @ivannz for the sum up! Just to be sure ... that means we wait for you to address those last points before a new review... right? |
We won't have time to finish the review on this one before the 1.2 release. Moving it to 1.3 |
@jeremiedbb @cmarmo I am sorry for not being able to pay due attention to the PR since mid September due to personal events. As soon as I get everything re-settled down (approximately in mid January 2023) i will get back to this PR. The plan is to fix the errors in the oc-SVM and SVDD docs and to address the three points in my last comment. |
Reference Issue
This PR covers previous issues concerning SVDD:
What does this implement/fix? Explain your changes.
This PR offers the following:
Any other comments?
The original model was proposed by Tax and Duin (2004), and later reformulated by Chang, Lee, Lin (2013). This PR implements the latter reformulation and extends it to the case of different weights of the observations. I can provide proof of the key theorems if necessary.