Skip to content
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

Refactor KMedoids #140

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ jobs:
- checkout
- run:
command: |
sudo python3 -m pip install black flake8
sudo python3 -m pip install pre-commit
- run:
command: |
black --check examples sklearn_extra *py
# ensure there is no unused imports with flake8
flake8
pre-commit install
pre-commit run --all-files

workflows:
version: 2
Expand Down
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ exclude_lines =
if 0:
if __name__ == .__main__.:
if self.verbose:
show_missing = True
show_missing = True
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 22.3.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this change, but it should be a separate PR :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True.

hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
Expand Down
3 changes: 1 addition & 2 deletions doc/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
- scikit-learn(>=0.21)
- Cython (>0.28)
### User Installation:
You can install scikit-learn-extra using this command:
You can install scikit-learn-extra using this command:
`pip install https://github.com/scikit-learn-contrib/scikit-learn-extra/archive/master.zip`

1 change: 0 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ scikit-learn-extra is a Python module for machine learning that extends scikit-l

contributing
changelog

12 changes: 6 additions & 6 deletions doc/modules/kernel_approximation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@ Kernel map approximation for faster kernel methods

.. currentmodule:: sklearn_extra.kernel_approximation

Kernel methods, which are among the most flexible and influential tools in
machine learning with applications in virtually all areas of the field, rely
Kernel methods, which are among the most flexible and influential tools in
machine learning with applications in virtually all areas of the field, rely
on high-dimensional feature spaces in order to construct powerfull classifiers or
regressors or clustering algorithms. The main drawback of kernel methods
is their prohibitive computational complexity. Both spatial and temporal complexity
is at least quadratic because we have to compute the whole kernel matrix.

One of the popular way to improve the computational scalability of kernel methods is
to approximate the feature map impicit behind the kernel method. In practice,
this means that we will compute a low dimensional approximation of the
this means that we will compute a low dimensional approximation of the
the otherwise high-dimensional embedding used to define the kernel method.

:class:`Fastfood` approximates feature map of an RBF kernel by Monte Carlo approximation
of its Fourier transform.

Fastfood replaces the random matrix of Random Kitchen Sinks
Fastfood replaces the random matrix of Random Kitchen Sinks
(`RBFSampler <https://scikit-learn.org/stable/modules/generated/sklearn.kernel_approximation.RBFSampler.html#sklearn.kernel_approximation.RBFSampler>`_)
with an approximation that uses the Walsh-Hadamard transformation to gain
significant speed and storage advantages. The computational complexity for
mapping a single example is O(n_components log d). The space complexity is
O(n_components).
O(n_components).

See `scikit-learn User-guide <https://scikit-learn.org/stable/modules/kernel_approximation.html#kernel-approximation>`_ for more general informations on kernel approximations.

See also :class:`EigenProRegressor <sklearn_extra.kernel_methods.EigenProRegressor>` and :class:`EigenProClassifier <sklearn_extra.kernel_methods.EigenProClassifier>` for another
See also :class:`EigenProRegressor <sklearn_extra.kernel_methods.EigenProRegressor>` and :class:`EigenProClassifier <sklearn_extra.kernel_methods.EigenProClassifier>` for another
way to compute fast kernel methods algorithms.
Loading