Skip to content

Commit

Permalink
simplify readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rcannood committed Sep 8, 2019
1 parent bcea542 commit 54457ce
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
10 changes: 3 additions & 7 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,15 @@ linearly with respect to the number of samples.
```{r compare}
library(lmds)
x <- as.matrix(iris[,1:4])
dimred <- lmds(
x,
ndim = 2,
distance_method = "euclidean",
landmark_method = "sample",
num_landmarks = 20
)
dimred <- lmds(x, ndim = 2)
qplot(dimred[,1], dimred[,2]) + labs(title = "lmds()") + theme_classic()
dimred <- cmdscale(dist(x))
qplot(dimred[,1], dimred[,2]) + labs(title = "cmdscale()") + theme_classic()
```


## Execution time
The execution time of `lmds()` scales linearly with respect to the dataset size.
```{r timings, echo=FALSE}
largex <- Matrix::rsparsematrix(nrow = 100000, ncol = 10000, density = .01)
Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@ Torgerson MDS. LMDS aims to produce the same dimensionality reduction as
``` r
library(lmds)
x <- as.matrix(iris[,1:4])
dimred <- lmds(
x,
ndim = 2,
distance_method = "euclidean",
landmark_method = "sample",
num_landmarks = 20
)
dimred <- lmds(x, ndim = 2)
qplot(dimred[,1], dimred[,2]) + labs(title = "lmds()") + theme_classic()
```

Expand All @@ -33,6 +27,8 @@ qplot(dimred[,1], dimred[,2]) + labs(title = "cmdscale()") + theme_classic()

<img src="man/figures/compare-2.png" width="100%" />

## Execution time

The execution time of `lmds()` scales linearly with respect to the
dataset size. <img src="man/figures/timings-1.png" width="100%" />

Expand Down
Binary file modified man/figures/compare-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/timings-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 54457ce

Please sign in to comment.