diff --git a/README.md b/README.md index 2c53312..327f0db 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,12 @@ You should be able to install from PyPI: pip install geosketch ``` -**For an example of usage of `geosketch` in R using the [`reticulate`](https://rstudio.github.io/reticulate/) library, see [`example.R`](example.R). WARNING: The indices returned by `geosketch` are 0-indexed, but R uses 1 indexing.** - ## API example usage **Parameter documentation for the geometric sketching `gs()` function is in the source code at the top of [`geosketch/sketch.py`](geosketch/sketch.py).** +**For an example of usage of `geosketch` in R using the [`reticulate`](https://rstudio.github.io/reticulate/) library, see [`example.R`](example.R). WARNING: The indices returned by `geosketch` are 0-indexed, but R uses 1-indexing, so the `one_indexed` parameter should be set to `TRUE` when called from R.** + Here is example usage of `geosketch` in Python. First, put your data set into a matrix: ``` X = [ sparse or dense matrix, samples in rows, features in columns ] diff --git a/example.R b/example.R index cc49988..78616d5 100644 --- a/example.R +++ b/example.R @@ -1,6 +1,6 @@ # WARNING: Sketch indices returned by geosketch are 0-indexed but R -# uses 1-indexing; indices should be shifted by 1 for any downstream -# analysis! +# uses 1-indexing; indices should be shifted by 1 by setting +# `one_indexed = TRUE` for any downstream analysis. library(reticulate) library(rsvd) @@ -16,5 +16,5 @@ X.pcs <- s$u %*% diag(s$d) # Sketch 10% of data. sketch.size <- as.integer(100) -sketch.indices <- geosketch$gs(X.pcs, sketch.size) +sketch.indices <- geosketch$gs(X.pcs, sketch.size, one_indexed = TRUE) print(sketch.indices) diff --git a/geosketch/__init__.py b/geosketch/__init__.py index 49d4b60..c0e72a0 100644 --- a/geosketch/__init__.py +++ b/geosketch/__init__.py @@ -1 +1,3 @@ from .sketch import * + +__version__ = '1.1' diff --git a/setup.py b/setup.py index baad963..647f446 100644 --- a/setup.py +++ b/setup.py @@ -2,10 +2,10 @@ setup( name='geosketch', - version='1.0', + version='1.1', description='Geometry-preserving random sampling', url='https://github.com/brianhie/geosketch', - download_url='https://github.com/brianhie/geosketch/archive/v1.0.tar.gz', + download_url='https://github.com/brianhie/geosketch/archive/v1.1.tar.gz', packages=find_packages(exclude=['bin', 'conf', 'data', 'target', 'R']), install_requires=[ 'fbpca>=1.0',