{"id":18668185,"url":"https://github.com/tensorly/viz","last_synced_at":"2025-04-12T00:23:11.833Z","repository":{"id":39585925,"uuid":"354456143","full_name":"tensorly/viz","owner":"tensorly","description":"Easy visualization and evaluation of matrix and tensor factorization models","archived":false,"fork":false,"pushed_at":"2023-01-20T16:23:44.000Z","size":141979,"stargazers_count":15,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-06T17:50:12.948Z","etag":null,"topics":["tensor-methods","tensorly","tensors","visualization"],"latest_commit_sha":null,"homepage":"https://tensorly.org/viz/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tensorly.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"docs/contributing.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null}},"created_at":"2021-04-04T04:35:30.000Z","updated_at":"2024-12-12T07:24:42.000Z","dependencies_parsed_at":"2023-02-12T03:31:19.894Z","dependency_job_id":null,"html_url":"https://github.com/tensorly/viz","commit_stats":null,"previous_names":["marieroald/component-vis","marieroald/tlvis"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tensorly%2Fviz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tensorly%2Fviz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tensorly%2Fviz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tensorly%2Fviz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tensorly","download_url":"https://codeload.github.com/tensorly/viz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248381789,"owners_count":21094528,"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":["tensor-methods","tensorly","tensors","visualization"],"created_at":"2024-11-07T08:41:44.819Z","updated_at":"2025-04-12T00:23:11.794Z","avatar_url":"https://github.com/tensorly.png","language":"Python","readme":"==================================================\nTLViz — Visualising and analysing component models\n==================================================\n\n.. image:: https://github.com/tensorly/viz/workflows/tests/badge.svg\n    :target: https://github.com/tensorly/viz/actions/workflows/tests.yml\n    :alt: Tests Status\n\n.. image:: https://codecov.io/gh/tensorly/viz/branch/main/graph/badge.svg?token=QhgCjtr2qk\n    :target: https://codecov.io/gh/tensorly/viz\n    :alt: Coverage Status\n\n.. image:: https://github.com/tensorly/viz/actions/workflows/build_doc.yml/badge.svg\n    :target: https://github.com/tensorly/viz/actions/workflows/build_doc.yml\n    :alt: Documentation Status\n\n.. image:: https://zenodo.org/badge/354456143.svg\n   :target: https://zenodo.org/badge/latestdoi/354456143\n   :alt: Zenodo DOI\n\n.. image:: https://joss.theoj.org/papers/10.21105/joss.04754/status.svg\n    :target: https://doi.org/10.21105/joss.04754\n    :alt: JOSS | 10.21105/joss.04754\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/psf/black\n    :alt: Code style: Black\n\nTLViz is a Python package for visualising component-based decomposition models like PARAFAC and PCA.\n\nDocumentation\n-------------\n\nThe documentation\nis available on `the TensorLy website \u003chttps://tensorly.org/viz\u003e`_ and includes\n\n* A `primer on tensors \u003chttp://tensorly.org/viz/stable/about_tensors.html#\u003e`_, `tensor factorisations \u003chttp://tensorly.org/viz/stable/about_tensors.html#what-are-tensor-factorisations\u003e`_ and the `notation we use \u003chttp://tensorly.org/viz/stable/about_tensors.html#notation\u003e`_\n* `An example gallery \u003chttp://tensorly.org/viz/stable/auto_examples/index.html\u003e`_\n* `The API reference \u003chttp://tensorly.org/viz/stable/api.html\u003e`_\n\n\nDependencies\n------------\n\nTLViz supports Python 3.8 or above (it may also work with Python 3.6 and 3.7, though that is not officially supported).\n\nInstallation requires matplotlib, numpy, pandas, scipy, statsmodels and xarray.\n\nInstallation\n------------\n\nTo install the latest stable release of TLViz and its dependencies, run:\n\n.. code:: raw\n\n    pip install tensorly-viz\n\nThere is also functionality to create improved QQ-plots with Pingoiun.\nHowever, this is disabled by default due to the restrictive GPL lisence.\nTo enable this possibility, you must manually `install Pingoiun \u003chttps://pingouin-stats.org\u003e`_.\n\nTo install the latest development version of TLViz, you can either clone\nthis repo or run\n\n.. code:: raw\n\n    pip install git+https://github.com/marieroald/tlviz.git\n\n\nSome extra dependencies are needed to run the examples, tests or build the documentation.\nFor more information about installing these dependencies, see the `installation guide \u003chttps://tensorly.org/viz/stable/installation.html\u003e`_.\n\nExample\n-------\n\n.. code:: python\n\n    import tlviz\n    import matplotlib.pyplot as plt\n    from tensorly.decomposition import parafac\n\n    def fit_parafac(dataset, num_components, num_inits):\n        model_candidates = [\n            parafac(dataset.data, num_components, init=\"random\", random_state=i)\n            for i in range(num_inits)\n        ]\n        model = tlviz.multimodel_evaluation.get_model_with_lowest_error(\n            model_candidates, dataset\n        )\n        return tlviz.postprocessing.postprocess(model, dataset)\n\n    data = tlviz.data.load_aminoacids()\n    cp_tensor = fit_parafac(data, 3, num_inits=3)\n    tlviz.visualisation.components_plot(cp_tensor)\n    plt.show()\n\n.. code:: raw\n\n    Loading Aminoacids dataset from:\n    Bro, R, PARAFAC: Tutorial and applications, Chemometrics and Intelligent Laboratory Systems, 1997, 38, 149-171\n\n.. image:: docs/figures/readme_example.svg\n    :width: 800\n    :alt: An example figure showing the component vectors of a three component PARAFAC model fitted to a fluoresence spectroscopy dataset.\n\nThis example uses TensorLy to fit five three-component PARAFAC models to the data. Then it uses TLViz to do the following steps:\n\n#. Select the model that gave the lowest reconstruction error.\n#. Normalise the component vectors, storing their magnitude in a separate weight-vector.\n#. Permute the components in descending weight (i.e. signal strength) order.\n#. Flip the components so they point in a logical direction compared to the data.\n#. Convert the factor matrices into Pandas DataFrames with logical indices.\n#. Plot the components using matplotlib.\n\nAll these steps are described in the `API documentation \u003chttps://tensorly.org/viz/stable/api.html\u003e`_ with references to the literature.\n\nTesting\n-------\n\nThe test suite requires an additional set of dependencies. To install these, run\n\n.. code:: raw\n\n    pip install tlviz[test]\n\nor\n\n.. code:: raw\n\n    pip install -e .[test]\n\ninside your local copy of the TLViz repository.\n\nThe tests can be run by calling ``pytest`` with no additional arguments.\nAll doctests are ran by default and a coverage summary will be printed on the screen.\nTo generate a coverage report, run ``coverage html``.\n\nContributing\n------------\n\nContributions are welcome to TLViz, see the `contribution guidelines \u003chttp://tensorly.org/viz/stable/contributing.html\u003e`_.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftensorly%2Fviz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftensorly%2Fviz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftensorly%2Fviz/lists"}