Skip to content

Commit 5fc1083

Browse files
committed
enhancement of documentation and version 1.4.0
1 parent 1069610 commit 5fc1083

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@ Radius clustering is a Python package that implements clustering under radius co
2020

2121
## Roadmap
2222

23-
- [ ] Version 2.0.0beta:
23+
- [x] Version 1.4.0:
2424
- [x] Add support for custom MDS solvers
25-
- [ ] Improve documentation and examples
26-
- [ ] Add iterative algorithm in both exact and approximate versions, which will allow to use the package in a more flexible way, especially when not knowing the radius beforehand.
27-
- [ ] Add more examples and tutorials
25+
- [x] Improve documentation and examples
26+
- [x] Add more examples and tutorials
2827

2928
## Installation
3029

docs/source/usage.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ Custom MDS Solver
8282
The two default solvers provided by the actual implementation of the `radius_clustering` package are focused on exactness (or proximity to exactness) of the results of a NP-hard problem. So, they may not be suitable for all use cases, especially when performance is a concern.
8383
If you have your own implementation of a Minimum Dominating Set (MDS) solver, you can use it with the `RadiusClustering` class ny using the :py:func:'RadiusClustering.set_solver' method. It will check that the solver is compatible with the expected input format and return type, and will use it to perform clustering.
8484

85+
.. versionadded:: 1.4.0
86+
The :py:func:`RadiusClustering.set_solver` method was added to allow users to set a custom MDS solver.
87+
It is *NOT* backward compatible with previous versions of the package, as it comes with new structure and methods to handle custom solvers.
88+
8589
Here's an example of how to implement a custom MDS solver and use it with the `RadiusClustering` class, using NetworkX implementation of the dominating set problem :
8690

8791
.. code-block:: python
@@ -122,6 +126,6 @@ Here's an example of how to implement a custom MDS solver and use it with the `R
122126

123127
.. attention::
124128
We cannot guarantee that the custom MDS solver will produce the same results as the default solvers, especially if it is not purposely designed to solve the Minimum Dominating Set problem but rather just finds a dominating set. The results may vary depending on the implementation and the specific characteristics of the dataset.
125-
As an example, a benchmark of our solutions and a custom one using NetworkX is available in the `Example Gallery` section of the documentation, which shows that the custom solver may produce different results than the default solvers, especially in terms of the number of clusters and the time taken to compute them.
129+
As an example, a benchmark of our solutions and a custom one using NetworkX is available in the `Example Gallery` section of the documentation, which shows that the custom solver may produce different results than the default solvers, especially in terms of the number of clusters and the time taken to compute them (see :ref:`sphx_glr_auto_examples_plot_benchmark_custom.py`).
126130
However, it can be useful for specific use cases where performance is a concern or when you have a custom implementation that fits your needs better.
127131

src/radius_clustering/algorithms.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
These functions can be replaced in the `RadiusClustering` class
66
to perform clustering using another algorithm.
77
8-
.. versionadded:: 2.0.0
8+
.. versionadded:: 1.4.0
99
Refactoring the structure of the code to separate the clustering algorithms
1010
This allows for easier maintenance and extensibility of the codebase.
11-
Plus, this allows for the addition of new clustering algorithms
12-
such as `Curgraph` added in this version.
11+
1312
"""
1413
from __future__ import annotations
1514

src/radius_clustering/radius_clustering.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,15 @@ class RadiusClustering(ClusterMixin, BaseEstimator):
5353
.. note::
5454
The `random_state_` attribute is not used when the `manner` is set to "exact".
5555
56-
.. versionchanged:: 2.0.0
56+
.. versionchanged:: 1.4.0
5757
The `RadiusClustering` class has been refactored.
5858
Clustering algorithms are now separated into their own module
5959
(`algorithms.py`) to improve maintainability and extensibility.
60+
61+
.. versionadded:: 1.4.0
62+
The `set_solver` method was added to allow users to set a custom solver
63+
for the MDS problem. This allows for flexibility in how the MDS problem is solved
64+
and enables users to use their own implementations of MDS clustering algorithms.
6065
6166
.. versionadded:: 1.3.0
6267
@@ -292,6 +297,9 @@ def set_solver(self, solver: callable) -> None:
292297
Set a custom solver for resolving the MDS problem.
293298
This method allows users to replace the default MDS solver with a custom one.
294299
300+
An example is provided below and in the example gallery :
301+
:ref:`sphx_glr_auto_examples_plot_benchmark_custom.py`
302+
295303
.. important::
296304
The custom solver must accept the same parameters as the default solvers
297305
and return a tuple containing the cluster centers and the execution time.

0 commit comments

Comments
 (0)