Skip to content

Commit ac127dd

Browse files
authored
Remove appx DBSCAN impl and replace with type aliases (rust-ml#298)
* Remove appx DBSCAN impl and replace with type aliases * Remove appx DBSCAN example and benchmark
1 parent c773a82 commit ac127dd

File tree

5 files changed

+13
-139
lines changed

5 files changed

+13
-139
lines changed

algorithms/linfa-clustering/Cargo.toml

+1-5
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ num-traits = "0.2"
3737
rand_xoshiro = "0.6"
3838
space = "0.12"
3939
thiserror = "1.0"
40-
partitions = "0.2.4"
40+
#partitions = "0.2.4" This one will break in a future version of Rust and has no replacement
4141
linfa = { version = "0.6.1", path = "../.." }
4242
linfa-nn = { version = "0.6.1", path = "../linfa-nn" }
4343
noisy_float = "0.2.0"
@@ -59,10 +59,6 @@ harness = false
5959
name = "dbscan"
6060
harness = false
6161

62-
[[bench]]
63-
name = "appx_dbscan"
64-
harness = false
65-
6662
[[bench]]
6763
name = "gaussian_mixture"
6864
harness = false

algorithms/linfa-clustering/README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@ You can find a roadmap (and a selection of good first issues)
1414
`linfa-clustering` currently provides implementation of the following clustering algorithms, in addition to a couple of helper functions:
1515
- K-Means
1616
- DBSCAN
17-
- Approximated DBSCAN
17+
- Approximated DBSCAN (Currently an alias for DBSCAN, due to its superior performance)
1818
- Gaussian Mixture Model
1919

2020

2121
Implementation choices, algorithmic details and a tutorial can be found
2222
[here](https://docs.rs/linfa-clustering).
2323

24-
**WARNING:** Currently the Approximated DBSCAN implementation is slower than the normal DBSCAN implementation. Therefore DBSCAN should always be used over Approximated DBSCAN.
25-
2624
## BLAS/Lapack backend
2725
We found that the pure Rust implementation maintained similar performance to the BLAS/LAPACK version and have removed it with this [PR](https://github.com/rust-ml/linfa/pull/257). Thus, to reduce code complexity BLAS support has been removed for this module.
2826

algorithms/linfa-clustering/benches/appx_dbscan.rs

-63
This file was deleted.

algorithms/linfa-clustering/examples/appx_dbscan.rs

-65
This file was deleted.

algorithms/linfa-clustering/src/lib.rs

+11-3
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,28 @@
1515
//! Right now `linfa-clustering` provides the following clustering algorithms:
1616
//! * [K-Means](KMeans)
1717
//! * [DBSCAN](Dbscan)
18-
//! * [Approximated DBSCAN](AppxDbscan)
18+
//! * [Approximated DBSCAN](AppxDbscan) (Currently an alias for DBSCAN, due to its superior
19+
//! performance)
1920
//! * [Gaussian-Mixture-Model](GaussianMixtureModel)
2021
//! * [OPTICS](OpticsAnalysis)
2122
//!
2223
//! Implementation choices, algorithmic details and tutorials can be found in the page dedicated to the specific algorithms.
23-
mod appx_dbscan;
2424
mod dbscan;
2525
mod gaussian_mixture;
2626
#[allow(clippy::new_ret_no_self)]
2727
mod k_means;
2828
mod optics;
2929

30-
pub use appx_dbscan::*;
3130
pub use dbscan::*;
3231
pub use gaussian_mixture::*;
3332
pub use k_means::*;
3433
pub use optics::*;
34+
35+
// Approx DBSCAN is currently an alias for DBSCAN, due to the old Approx DBSCAN implementation's
36+
// lower performance and outdated dependencies
37+
38+
use linfa_nn::distance::L2Dist;
39+
pub type AppxDbscanValidParams<F, N> = DbscanValidParams<F, L2Dist, N>;
40+
pub type AppxDbscanParams<F, N> = DbscanParams<F, L2Dist, N>;
41+
pub type AppxDbscanParamsError = DbscanParamsError;
42+
pub type AppxDbscan = Dbscan;

0 commit comments

Comments
 (0)