{"id":17220812,"url":"https://github.com/kojix2/ruby-umappp","last_synced_at":"2025-04-13T22:33:00.397Z","repository":{"id":61049341,"uuid":"451478217","full_name":"kojix2/ruby-umappp","owner":"kojix2","description":"Uniform Manifold Approximation and Projection for Ruby","archived":false,"fork":false,"pushed_at":"2025-01-17T03:53:52.000Z","size":1514,"stargazers_count":8,"open_issues_count":3,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-21T03:47:08.534Z","etag":null,"topics":["ruby","umap"],"latest_commit_sha":null,"homepage":"https://kojix2.github.io/ruby-umappp","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kojix2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"kojix2"}},"created_at":"2022-01-24T13:36:58.000Z","updated_at":"2025-01-17T03:53:42.000Z","dependencies_parsed_at":"2024-01-29T06:53:52.357Z","dependency_job_id":"6c6ea779-dc1b-46da-82fa-c4d325fc805f","html_url":"https://github.com/kojix2/ruby-umappp","commit_stats":{"total_commits":97,"total_committers":2,"mean_commits":48.5,"dds":"0.010309278350515427","last_synced_commit":"52b54e4d1538afe91969bb39f1c363eaf81b53bb"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojix2%2Fruby-umappp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojix2%2Fruby-umappp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojix2%2Fruby-umappp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kojix2%2Fruby-umappp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kojix2","download_url":"https://codeload.github.com/kojix2/ruby-umappp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248790822,"owners_count":21162092,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ruby","umap"],"created_at":"2024-10-15T03:53:18.663Z","updated_at":"2025-04-13T22:32:57.926Z","avatar_url":"https://github.com/kojix2.png","language":"C++","funding_links":["https://ko-fi.com/kojix2"],"categories":[],"sub_categories":[],"readme":"# Umappp - UMAP for Ruby\n\n[![test](https://github.com/kojix2/ruby-umappp/actions/workflows/ci.yml/badge.svg)](https://github.com/kojix2/ruby-umappp/actions/workflows/ci.yml)\n[![Gem Version](https://badge.fury.io/rb/umappp.svg)](https://badge.fury.io/rb/umappp)\n\n🗺️ [Umappp](https://github.com/LTLA/umappp) - Uniform Manifold Approximation and Projection - for Ruby\n\n![image](https://user-images.githubusercontent.com/5798442/155692246-fa8e0fb0-33c2-4265-a1bf-228d4f80ebdb.png)\n\n\u003e Uniform Manifold Approximation and Projection (UMAP) is a dimension reduction technique that can be used for visualisation similarly to t-SNE, but also for general non-linear dimension reduction. \n\u003e ([original UMAP documentation](https://umap-learn.readthedocs.io/en/latest/index.html))\n\n* Ruby Umappp is a wrapper library for [C++ Umappp library](https://github.com/LTLA/umappp) created by Aaron Lun \n* Compatible with [yaumap](https://github.com/LTLA/yaumap)\n* Support [Numo::NArray](https://github.com/ruby-numo/numo-narray)\n\n## Installation\n\n```\ngem install umappp\n```\n\n* [OpenMP](https://www.openmp.org) is required for multithreading.\n\n## Usage\n\nThis Gem provides the module `Umappp` and its singular method `Umappp.run()`. The first argument of `Umappp.run()` is a two-dimensional Ruby array or a two-dimensional Numo array. [Numo](https://github.com/ruby-numo/numo-narray) is a library for performing N-dimensional array computing like NumPy. The argument is converted to `Numo::SFloat`. SFloat is a single precision floating point number type of Numo::NArray.\n\n```ruby\n# The embedding is two-dimensional Ruby array or Numo array\n# Returns Numo::SFloat\nr = Umappp.run(embedding)\n\n# Run with parameters\nr = Umappp.run(pixels, num_threads: 8, a: 1.8956, b: 0.8006)\n```\n\nAvailable parameters and their default values\n\n| parameters           | default value                      |\n|----------------------|------------------------------------|\n| method               | :annoy (another option is :vptree) |\n| ndim                 | 2                                  |\n| local_connectivity   | 1.0                                |\n| bandwidth            | 1                                  |\n| mix_ratio            | 1                                  |\n| spread               | 1                                  |\n| min_dist             | 0.01                               |\n| a                    | 0                                  |\n| b                    | 0                                  |\n| repulsion_strength   | 1                                  |\n| initialize           | Umappp::InitMethod::SPECTRAL       |\n| num_epochs           | 500                                |\n| learning_rate        | 1                                  |\n| negative_sample_rate | 5                                  |\n| num_neighbors        | 15                                 |\n| seed                 | 1234567890                         |\n| num_threads          | 1 (OpenMP required)                |\n\n## Development\n\n```\ngit clone https://github.com/kojix2/ruby-umappp\ncd umap\nbundle exec rake compile\nbundle exec rake test\n```\n\nUpdate LTLA/umappp\n\nRequires cmake to run\n\n```\ncd script\n./vendor.sh\n```\n\n### Ruby dependencies\n\n* [rice](https://github.com/jasonroelofs/rice) - Ruby Interface for C++ Extensions\n* [numo.hpp](https://github.com/ankane/numo.hpp) - C++ header for Numo and Rice\n\n### Umappp dependencies\n\nThis Gem is a wrapper for [Umappp](https://github.com/LTLA/umappp). We store and distribute Umappp and other dependent C++ code in the Vendor directory. Umappp is compiled when the Gem is installed. Umappp's C++ modules have complex dependencies as shown in the figure below. It is not a good idea to manage them manually. Use `script/vendor.sh` to update them automatically. This actually runs cmake and moves the required directories to the vendor directory.\n\n\n```mermaid\ngraph TD;\n    id1(eigen)--\u003eCppIrlba;\n    aarand--\u003eCppIrlba;\n    Annoy--\u003eknncolle;\n    hnswlib--\u003eknncolle;\n    CppKmeans--\u003eknncolle;\n    aarand--\u003eCppKmeans;\n    powerit--\u003eCppKmeans;\n    aarand--\u003epowerit;\n    knncolle--\u003eumappp;\n    aarand--\u003eumappp;\n    CppIrlba--\u003eumappp;\n    style id1 fill:#f9f,stroke:#333\n```\n\nAll modules except eigen are the work of Aaron Lun.\n\n## Contributing\n\nWelcome!\n\n    Do you need commit rights to my repository?\n    Do you want to get admin rights and take over the project?\n    If so, please feel free to contact us @kojix2.\n\n## License\n\n* As for the code I wrote, it is  BSD 2-Clause (or MIT).\n* The license of Umappp for C++ by Aaron Lun is BSD 2-Clause.\n* For other codes, please check on your own. (There are many dependencies)\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkojix2%2Fruby-umappp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkojix2%2Fruby-umappp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkojix2%2Fruby-umappp/lists"}