{ "info": { "author": "Ehsan Amid", "author_email": "eamid@ucsc.edu", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Intended Audience :: Science/Research", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: C", "Programming Language :: Python", "Programming Language :: Python :: 3.6", "Topic :: Scientific/Engineering" ], "description": "======\nTriMap\n======\n\nTriMap is a dimensionality reduction method that uses triplet constraints\nto form a low-dimensional embedding of a set of points. The triplet constraints\nare of the form \"point *i* is closer to point *j* than point *k*\". The triplets are \nsampled from the high-dimensional representation of the points and a weighting \nscheme is used to reflect the importance of each triplet. \n\nTriMap provides a significantly better global view of the data than the\nother dimensionality reduction methods such t-SNE, LargeVis, and UMAP. The global \nstructure includes relative distances of the clusters, multiple scales in \nthe data, and the existence of possible outliers. We define a global score to quantify the quality of an embedding in reflecting the global structure of the data.\n\nThe following implementation is in Python. Further details and more experimental results are available in the `paper `_. \n\n\n-----------------\nHow to use TriMap\n-----------------\n\nTriMap has a transformer API similar to other sklearn libraries. To use \nTriMap with the default parameters, simply do:\n\n.. code:: python\n\n import trimap\n from sklearn.datasets import load_digits\n\n digits = load_digits()\n\n embedding = trimap.TRIMAP().fit_transform(digits.data)\n\nTo calculate the global score, do:\n\n.. code:: python\n\n gs = trimap.TRIMAP(verbose=False).global_score(digits.data, embedding)\n print(\"global score %2.2f\" % gs)\n\n\n-----------------\nParameters\n-----------------\n\nThe list of parameters is given blow:\n\n - ``n_inliers``: Number of nearest neighbors for forming the nearest neighbor triplets (default = 10).\n\n - ``n_outliers``: Number of outliers for forming the nearest neighbor triplets (default = 5).\n\n - ``n_random``: Number of random triplets per point (default = 5).\n\n - ``distance``: Distance measure ('euclidean' (default), 'manhattan', 'angular', 'hamming')\n\n - ``weight_adj``: The value of gamma for the log-transformation (default = 500.0).\n\n - ``lr``: Learning rate (default = 1000.0).\n\n - ``n_iters``: Number of iterations (default = 400).\n \nThe other parameters include:\n\n - ``knn_tuple``: Use the pre-computed nearest-neighbors information in form of a tuple (knn_nbrs, knn_distances) (default = None)\n\n - ``apply_pca``: Reduce the number of dimensions of the data to 100 if necessary before applying the nearest-neighbor search (default = True).\n\n - ``opt_method``: Optimization method {'sd' (steepest descent), 'momentum' (GD with momentum), 'dbd' (delta-bar-delta, default)}.\n\n - ``verbose``: Print the progress report (default = True).\n\n - ``return_seq``: Store the intermediate results and return the results in a tensor (default = False).\n\nAn example of adjusting these parameters:\n\n.. code:: python\n\n import trimap\n from sklearn.datasets import load_digits\n\n digits = load_digits()\n\n embedding = trimap.TRIMAP(n_inliers=20,\n n_outliers=10,\n n_random=10,\n weight_adj=1000.0).fit_transform(digits.data)\n\nThe nearest-neighbor calculation is performed using `ANNOY `_. \n\n\n--------\nExamples\n--------\n\nThe following are some of the results on real-world datasets. The values of nearest-neighbor accuracy and global score are shown as a pair (NN, GS) on top of each figure. For more results, please refer to our `paper `_.\n\nUSPS Handwritten Digits (*n = 11,000, d = 256*)\n\n.. image:: results/usps.png\n :alt: Visualizations of the USPS dataset\n\n20 News Groups (*n = 18,846, d = 100*)\n\n.. image:: results/news20.png\n :alt: Visualizations of the 20 News Groups dataset\n\nTabula Muris (*n = 53,760, d = 23,433*)\n\n.. image:: results/tabula.png\n :alt: Visualizations of the Tabula Muris Mouse Tissues dataset\n\nMNIST Handwritten Digits (*n = 70,000, d = 784*)\n\n.. image:: results/mnist.png\n :alt: Visualizations of the MNIST dataset\n\nFashion MNIST (*n = 70,000, d = 784*)\n\n.. image:: results/fmnist.png\n :alt: Visualizations of the Fashion MNIST dataset\n \nTV News (*n = 129,685, d = 100*)\n\n.. image:: results/tvnews.png\n :alt: Visualizations of the TV News dataset\n\n\nRuntime of t-SNE, LargeVis, UMAP, and TriMap in the hh:mm:ss format on a single machine with 2.6 GHz Intel Core i5 CPU and 16 GB of memory is given in the following table. We limit the runtime of each method to 12 hours. Also, UMAP runs out of memory on datasets larger than ~4M points.\n\n.. image:: results/runtime.png\n :alt: Runtime of TriMap compared to other methods\n\n\n----------\nInstalling\n----------\n\nRequirements:\n\n* numpy\n* scikit-learn\n* numba\n* annoy\n\n**Install Options**\n\nIf you have all the requirements installed, you can use pip:\n\n.. code:: bash\n\n sudo pip install trimap\n \nPlease regularly check for updates and make sure you are using the most recent version. If you have TriMap installed and would like to upgrade to the newer version, you can use the command:\n\n.. code:: bash\n\n sudo pip install --upgrade --force-reinstall trimap\n\nAn alternative is to install the dependencies manually using anaconda and using pip \nto install TriMap:\n\n.. code:: bash\n\n conda install numpy\n conda install scikit-learn\n conda install numba\n conda install annoy\n pip install trimap\n\nFor a manual install get this package:\n\n.. code:: bash\n\n wget https://github.com/eamid/trimap/archive/master.zip\n unzip master.zip\n rm master.zip\n cd trimap-master\n\nInstall the requirements\n\n.. code:: bash\n\n sudo pip install -r requirements.txt\n\nor\n\n.. code:: bash\n\n conda install scikit-learn numba annoy\n\nInstall the package\n\n.. code:: bash\n\n python setup.py install\n\n\n------------------------\nSupport and Contribution\n------------------------\n\nThis implementation is still a work in progress. Any comments/suggestions/bug-reports\nare highly appreciated. Please feel free contact me at: eamid@ucsc.edu. If you would \nlike to contribute to the code, please `fork the project `_\nand send me a pull request.\n\n\n--------\nCitation\n--------\n\nIf you use TriMap in your publications, please cite our current reference on arXiv:\n\n::\n\n @article{2019TRIMAP,\n author = {{Amid}, E. and {Warmuth}, M. K.},\n title = \"{TriMap: Large-scale Dimensionality Reduction Using Triplets}\",\n journal = {ArXiv e-prints},\n archivePrefix = \"arXiv\",\n eprint = {1910.00204},\n year = 2019,\n }\n\n\n-------\nLicense\n-------\n\nPlease see the LICENSE file.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/eamid/trimap", "keywords": "Dimensionality Reduction Triplets t-SNE LargeVis UMAP", "license": "LICENSE.txt", "maintainer": "", "maintainer_email": "", "name": "trimap", "package_url": "https://pypi.org/project/trimap/", "platform": "", "project_url": "https://pypi.org/project/trimap/", "project_urls": { "Homepage": "http://github.com/eamid/trimap" }, "release_url": "https://pypi.org/project/trimap/1.0.12/", "requires_dist": null, "requires_python": "", "summary": "TriMap: Large-scale Dimensionality Reduction Using Triplets", "version": "1.0.12" }, "last_serial": 5970292, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "fa9648e14f2804042161376aa99c7467", "sha256": "7b61cf91090aa5d2722bd630b90b87612f1857d8a6ac5d4057b66e6b2ed58737" }, "downloads": -1, "filename": "trimap-1.0.1.tar.gz", "has_sig": false, "md5_digest": "fa9648e14f2804042161376aa99c7467", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11372, "upload_time": "2019-07-20T00:56:04", "url": "https://files.pythonhosted.org/packages/88/6c/a60c5608815dbd00b6d879b2367ff8184ae8d2729ec5f6bc883eb3f9fcfe/trimap-1.0.1.tar.gz" } ], "1.0.10": [ { "comment_text": "", "digests": { "md5": "39d2169ef085f140623f8bdd0b7c6d12", "sha256": "030b956ae3555d49e9ad606bef671d413596b30f3f7aebe19ebfc719b0d60d99" }, "downloads": -1, "filename": "trimap-1.0.10.tar.gz", "has_sig": false, "md5_digest": "39d2169ef085f140623f8bdd0b7c6d12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11878, "upload_time": "2019-10-05T21:45:31", "url": "https://files.pythonhosted.org/packages/d4/1c/e11b5d27102a1cc0849833a24f8f5afe8ecd86d40f1a28e6e122c4f0174a/trimap-1.0.10.tar.gz" } ], "1.0.11": [ { "comment_text": "", "digests": { "md5": "7be878b55de14f8d86105e1ef147d0ab", "sha256": "9f5080f1d9b96c5ec9dfae1b52add3a7e47f3aa01705524f3389d8f4538a43d1" }, "downloads": -1, "filename": "trimap-1.0.11.tar.gz", "has_sig": false, "md5_digest": "7be878b55de14f8d86105e1ef147d0ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11937, "upload_time": "2019-10-07T18:28:27", "url": "https://files.pythonhosted.org/packages/30/c0/eb9750dfd924d30ad50ba54b4b956c73d87c79262e9a3313442c8f550d7a/trimap-1.0.11.tar.gz" } ], "1.0.12": [ { "comment_text": "", "digests": { "md5": "5a5a78b8fa71a617aa1f5df8dc26908c", "sha256": "d2258978fbf08397b23d1692cde71e00b4162e40ff79e2db238c8738f38ec306" }, "downloads": -1, "filename": "trimap-1.0.12.tar.gz", "has_sig": false, "md5_digest": "5a5a78b8fa71a617aa1f5df8dc26908c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12212, "upload_time": "2019-10-14T08:01:43", "url": "https://files.pythonhosted.org/packages/49/62/bca15ce2cba7dd995c75c018e926673e9df22849ce7f671250aeeea2acd8/trimap-1.0.12.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "cd4a22224a16c4da16c578c37e620301", "sha256": "f4a0332e7263a7322fe667166d2565c4d2d61542cfa86e703843f8dd84918299" }, "downloads": -1, "filename": "trimap-1.0.2.tar.gz", "has_sig": false, "md5_digest": "cd4a22224a16c4da16c578c37e620301", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10725, "upload_time": "2019-07-20T01:13:35", "url": "https://files.pythonhosted.org/packages/19/9d/fa4a8b71c5004b61e9ea900f8405b3c897740f87231089779822ca6bd207/trimap-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "d9d44fd47af6bfad7ab4d96c14b142e1", "sha256": "e421f820d1184313a8196cc4312bae4e0b1f088c2c8024c7d8543a7fe5b4a690" }, "downloads": -1, "filename": "trimap-1.0.3.tar.gz", "has_sig": false, "md5_digest": "d9d44fd47af6bfad7ab4d96c14b142e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10738, "upload_time": "2019-07-20T01:45:48", "url": "https://files.pythonhosted.org/packages/cf/d3/ad89ff0740ad307dfcd1723afbbc8a44582916537540167532fd540886b0/trimap-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "e143502e0855fd84737237adc925dba8", "sha256": "7fe677b4857bfc18096a0afca9cc60874b9b8b3669e7206e58bed19fe6b119e5" }, "downloads": -1, "filename": "trimap-1.0.4.tar.gz", "has_sig": false, "md5_digest": "e143502e0855fd84737237adc925dba8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10718, "upload_time": "2019-07-20T05:47:44", "url": "https://files.pythonhosted.org/packages/43/75/92293e3160a2c6552bc1df22590ee6d54faf80ad4f628379c111a5ac8a7d/trimap-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "55db8a4e554b8057d02e2ceee3e5e8fd", "sha256": "6ad945271f90c2120ae35232a4dd63f5c58c403a643377feb4509184108703c7" }, "downloads": -1, "filename": "trimap-1.0.5.tar.gz", "has_sig": false, "md5_digest": "55db8a4e554b8057d02e2ceee3e5e8fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10939, "upload_time": "2019-09-28T22:56:54", "url": "https://files.pythonhosted.org/packages/61/3b/e551dd26a29ba60ef3ab101596d683b4df4db65ffc3a9f69a2906cf119d1/trimap-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "d9c176d9daf4cb42a6b6f6b0342d3287", "sha256": "90849a6979813b078c85cf1b829fa5e7bb10314e147154520eba330da219496c" }, "downloads": -1, "filename": "trimap-1.0.6.tar.gz", "has_sig": false, "md5_digest": "d9c176d9daf4cb42a6b6f6b0342d3287", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10941, "upload_time": "2019-09-29T04:59:44", "url": "https://files.pythonhosted.org/packages/bb/ef/3ce6818ad85dc35eac2dd5c88bc99dd3d250d8d79428de6802eafa2f657d/trimap-1.0.6.tar.gz" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "933e85d0356e48efd969786c5aa199f5", "sha256": "91a0fb4ab0ea6c4d0a8b9a1a38a07700fe24979068b1b1c1b24f8380864c8e0d" }, "downloads": -1, "filename": "trimap-1.0.7.tar.gz", "has_sig": false, "md5_digest": "933e85d0356e48efd969786c5aa199f5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10935, "upload_time": "2019-09-29T05:19:33", "url": "https://files.pythonhosted.org/packages/c2/ab/09da59117badd514e6d1b3efcef6c42789328fcac42a2878aef98c76ef86/trimap-1.0.7.tar.gz" } ], "1.0.8": [ { "comment_text": "", "digests": { "md5": "1847a9fd9991d8932f3a79bedda193ab", "sha256": "914d743ddc45d2f8848d4043b72026c618c4ec68f45a9ef2383577ede92e297d" }, "downloads": -1, "filename": "trimap-1.0.8.tar.gz", "has_sig": false, "md5_digest": "1847a9fd9991d8932f3a79bedda193ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10899, "upload_time": "2019-10-03T18:06:01", "url": "https://files.pythonhosted.org/packages/95/7b/4e0ab1299bf83dc75f84c7f6b8149dac6ec0e4bb428d3054897804402d78/trimap-1.0.8.tar.gz" } ], "1.0.9": [ { "comment_text": "", "digests": { "md5": "dce1ff0eddbafb7938e44576eb6384d8", "sha256": "dd6b830ee4b7bffcc77067258ae9a9e69f053710f4767ff9a136c2367e5947c8" }, "downloads": -1, "filename": "trimap-1.0.9.tar.gz", "has_sig": false, "md5_digest": "dce1ff0eddbafb7938e44576eb6384d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11467, "upload_time": "2019-10-04T04:29:49", "url": "https://files.pythonhosted.org/packages/3b/80/742d109e5b918f1d207885ef47cfe0b0b7df4c13808e39e81148801edb9b/trimap-1.0.9.tar.gz" } ], "1.3.0.dev1": [ { "comment_text": "", "digests": { "md5": "e1a516836bb83cb94e9108876e1a57e9", "sha256": "2331904b7ac97aa555122f7d34b17ca8b1f31eb4441c99cf883fea044c39c8f2" }, "downloads": -1, "filename": "trimap-1.3.0.dev1.tar.gz", "has_sig": false, "md5_digest": "e1a516836bb83cb94e9108876e1a57e9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6961, "upload_time": "2018-04-28T18:27:03", "url": "https://files.pythonhosted.org/packages/e8/a1/8ef99e25d0d4f7e13f65fea81dbb5341be42266241356e9b67eab3817b8e/trimap-1.3.0.dev1.tar.gz" } ], "1.4.0.dev1": [ { "comment_text": "", "digests": { "md5": "9990d3f096e10b568791d03f3374aee2", "sha256": "3a56e8e616b32ba5e98567e3297bf5a80ce7a40473fc63d5e74d2c30b51d460f" }, "downloads": -1, "filename": "trimap-1.4.0.dev1.tar.gz", "has_sig": false, "md5_digest": "9990d3f096e10b568791d03f3374aee2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7595, "upload_time": "2018-06-10T22:13:23", "url": "https://files.pythonhosted.org/packages/25/35/97c2ef45444dc7f95d8cb5f7be894a6e2315b7245de8e597d4a251b494c7/trimap-1.4.0.dev1.tar.gz" } ], "1.4.1.dev1": [ { "comment_text": "", "digests": { "md5": "9d3d3554491fba17082078924956d9ba", "sha256": "8f974a037efaaf8c04058dd2777703d8f20429b9c1418f78ee4c74d9e29e69cf" }, "downloads": -1, "filename": "trimap-1.4.1.dev1.tar.gz", "has_sig": false, "md5_digest": "9d3d3554491fba17082078924956d9ba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8695, "upload_time": "2018-09-29T07:13:30", "url": "https://files.pythonhosted.org/packages/5c/d8/d82f58a02282ac35525b9820a43a0debbe9aab5fd80e0e185ecb44224de3/trimap-1.4.1.dev1.tar.gz" } ], "1.4.2.dev1": [ { "comment_text": "", "digests": { "md5": "7a0d8ec1e0e29c3f54971ea19fbd7d7d", "sha256": "3ae9a57490c2e9c7e87bed17931bc57e86cfd1fb4cf24ef8c8fa9157244af433" }, "downloads": -1, "filename": "trimap-1.4.2.dev1.tar.gz", "has_sig": false, "md5_digest": "7a0d8ec1e0e29c3f54971ea19fbd7d7d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8770, "upload_time": "2018-09-29T08:43:31", "url": "https://files.pythonhosted.org/packages/4c/ef/db361ba84d10710b88fcc50823662b9d7a2296d93470ce141678e5c64ace/trimap-1.4.2.dev1.tar.gz" } ], "1.4.3.dev1": [ { "comment_text": "", "digests": { "md5": "d56740ca6dba23b6497d2b16c46205a7", "sha256": "b7acdbe1aaa5695c79674b9f6ec840b20086fc80a76ead71af329c94c6ba33a8" }, "downloads": -1, "filename": "trimap-1.4.3.dev1.tar.gz", "has_sig": false, "md5_digest": "d56740ca6dba23b6497d2b16c46205a7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10883, "upload_time": "2018-11-18T01:42:06", "url": "https://files.pythonhosted.org/packages/1d/1b/3c42594fba18e0babb5b14158736dd1279a38ba93f3b94ca37489ebd5663/trimap-1.4.3.dev1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5a5a78b8fa71a617aa1f5df8dc26908c", "sha256": "d2258978fbf08397b23d1692cde71e00b4162e40ff79e2db238c8738f38ec306" }, "downloads": -1, "filename": "trimap-1.0.12.tar.gz", "has_sig": false, "md5_digest": "5a5a78b8fa71a617aa1f5df8dc26908c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12212, "upload_time": "2019-10-14T08:01:43", "url": "https://files.pythonhosted.org/packages/49/62/bca15ce2cba7dd995c75c018e926673e9df22849ce7f671250aeeea2acd8/trimap-1.0.12.tar.gz" } ] }