Skip to content

Commit 03a495a

Browse files
committed
Add missing import time in README.
Also clarify that a distance matrix needs to be given. Closes #16 differently
1 parent 2b8bac1 commit 03a495a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ On other architectures (Windows, OSX), you may need to first
5656
`pip install kmedoids` will try to compile the package for your CPU architecture and operating system.
5757

5858
### Compilation from source
59+
5960
You need to have Python 3 installed.
6061

6162
Unless you already have Rust, [install Rust/Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html).
@@ -82,6 +83,8 @@ by setting the `path=` option of the `kmedoids` dependency.
8283

8384
## Example
8485

86+
Given a distance matrix `distmatrix`, cluster into `k = 5` clusters:
87+
8588
```python
8689
import kmedoids
8790
c = kmedoids.fasterpam(distmatrix, 5)
@@ -103,8 +106,7 @@ print("Loss is:", c.inertia_)
103106
### MNIST (10k samples)
104107

105108
```python
106-
import kmedoids
107-
import numpy
109+
import kmedoids, numpy, time
108110
from sklearn.datasets import fetch_openml
109111
from sklearn.metrics.pairwise import euclidean_distances
110112
X, _ = fetch_openml('mnist_784', version=1, return_X_y=True, as_frame=False)

0 commit comments

Comments
 (0)