Barnes-Hut implementation of t-SNE written in Rust. The algorithm is described with fine detail in this paper by Laurens van der Maaten.
Add this line to your Cargo.toml
:
toml
[dependencies]
bhtsne = "0.3.1"
```rust use bhtsne;
// Parameters template. let n: usize = 8; // Number of vectors to embed. let d: usize = 4; // The dimensionality of the original space. let theta: f32 = 0.5; // The parameter used by the Barnes-Hut algorithm. When set to 0.0 // the exact t-SNE version is used instead.
let perplexity = 1.0; // The perplexity of the conditional distribution. let maxiter = 2000; // The number of fitting iterations. let nodims = 2; // The dimensionality of the embedded space.
// Loads data the from a csv file skipping the first row,
// treating it as headers and skipping the 5th column,
// treating it as a class label.
let mut data: Vec
The following embedding has been obtained by preprocessing the MNIST dataset using PCA to reduce its
dimensionality to 50. It took approximately 17 mins on a 2.0GHz quad-core 10th-generation i5 MacBook Pro.