From f2a286de2bfeb9cfcdd5b429edd1fc36b4db7915 Mon Sep 17 00:00:00 2001 From: fabio-cumbo Date: Thu, 1 Jun 2023 12:19:34 -0400 Subject: [PATCH] Update README.md --- README.md | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 7b67800..cedce21 100644 --- a/README.md +++ b/README.md @@ -94,20 +94,20 @@ space = Space(from_file="~/space.pkl") Here is the list of Space class methods: -| Method | Signature | Description | -|:-------------|:------------------------------------------------|:-------------| -| `memory` | | Return a list with Vector IDs | -| `get` | `names: list, tags: list` | Return a list of Vector objects based on a list of Vector IDs or tags | -| `insert` | `vector: Vector` | Insert a Vector object into the Space | -| `bulkInsert` | `names: list, tags: list` | Automatically create a Vector object for each of the ID in the input `names` list and finally insert them into the Space. Also tag vectors based on tags in the `tags` list of lists. Tags in position `i` are assigned to the Vector object whose name is in position `i` of the `vectors` list | -| `remove` | `name: str` | Remove a Vector object from the Space based on its ID | -| `add_tag` | `name: str, tag: str` | Assign a tag to a Vector object in the Space | -| `remove_tag` | `name: str, tag: str` | Remove a tag to a Vector object in the Space | -| `link` | `name1: str, name2: str` | Link two vectors in the Space. Note that links are directed | -| `set_root` | `name: str` | Vector links can be used to define a tree structure. Set a specific vector as root | -| `find` | `vector: Vector, threshold: float, method: str` | Given a specific Vector object, search for the closest Vector in the Space according to a specific distance metric: `cosine`, `hamming`, or `euclidean` | -| `find_all` | `vector: Vector, threshold: float, method: str` | Report the distance between the input Vector object and all the other Vectors in the Space | -| `dump` | `to_file: str` | Dump the Space object to a pickle file | +| Method | Signature | Description | +|:--------------|:------------------------------------------------|:-------------| +| `memory` | | Return a list with Vector IDs | +| `get` | `names: list, tags: list` | Return a list of Vector objects based on a list of Vector IDs or tags | +| `insert` | `vector: Vector` | Insert a Vector object into the Space | +| `bulk_insert` | `names: list, tags: list` | Automatically create a Vector object for each of the ID in the input `names` list and finally insert them into the Space. Also tag vectors based on tags in the `tags` list of lists. Tags in position `i` are assigned to the Vector object whose name is in position `i` of the `vectors` list | +| `remove` | `name: str` | Remove a Vector object from the Space based on its ID | +| `add_tag` | `name: str, tag: str` | Assign a tag to a Vector object in the Space | +| `remove_tag` | `name: str, tag: str` | Remove a tag to a Vector object in the Space | +| `link` | `name1: str, name2: str` | Link two vectors in the Space. Note that links are directed | +| `set_root` | `name: str` | Vector links can be used to define a tree structure. Set a specific vector as root | +| `find` | `vector: Vector, threshold: float, method: str` | Given a specific Vector object, search for the closest Vector in the Space according to a specific distance metric: `cosine`, `hamming`, or `euclidean` | +| `find_all` | `vector: Vector, threshold: float, method: str` | Report the distance between the input Vector object and all the other Vectors in the Space | +| `dump` | `to_file: str` | Dump the Space object to a pickle file | ### Arithmetic Operations @@ -123,6 +123,15 @@ Here are the characteristics of these operators: | `bind` | (i) Invertible (unbind), (ii) it distributes over bundling, (iii) it preserves the distance, and (iv) the resulting vector is dissimilar to the input vectors | | `permute` | (i) Invertible, (ii) it distributes over bundling and any elementwise operation, (iii) it preserves the distance, and (iv) the resulting vector is dissimilar to the input vectors | +### Utilities + +The `hdlib` library also provides a set of utilities for dealing with input datasets collected under the `parser` module: + +| Method | Signature | Description | +|:----------------|:--------------------------|:-------------| +| `load_dataset` | `filepath: str, sep: str` | Given a numerical matrix file, load the list of samples, features, classes, and the matrix with numerical data | +| `split_dataset` | `points: int, folds: int` | Given a number of data points and the number of folds, split a dataset into different folds | + ## Contributing Long-term discussion and bug reports are maintained via GitHub Issues, while code review is managed via GitHub Pull Requests.