{"id":21031990,"url":"https://github.com/advestis/adnmtf","last_synced_at":"2025-05-15T12:31:30.120Z","repository":{"id":41892008,"uuid":"351726126","full_name":"Advestis/adnmtf","owner":"Advestis","description":"Non-Negative Matrix and Tensor Factorizations","archived":false,"fork":false,"pushed_at":"2024-04-29T16:34:40.000Z","size":8718,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T21:48:24.422Z","etag":null,"topics":["data-completion","data-science","dimensionality-reduction","machine-learning","matrix","nmtf"],"latest_commit_sha":null,"homepage":"https://advestis.github.io/adnmtf/","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/Advestis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2021-03-26T09:21:30.000Z","updated_at":"2024-06-12T07:20:04.000Z","dependencies_parsed_at":"2024-11-17T00:20:15.902Z","dependency_job_id":null,"html_url":"https://github.com/Advestis/adnmtf","commit_stats":{"total_commits":255,"total_committers":7,"mean_commits":36.42857142857143,"dds":0.3294117647058824,"last_synced_commit":"a32f048273cf2268f79752dbee4e696eec7aa922"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Advestis%2Fadnmtf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Advestis%2Fadnmtf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Advestis%2Fadnmtf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Advestis%2Fadnmtf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Advestis","download_url":"https://codeload.github.com/Advestis/adnmtf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254341134,"owners_count":22054984,"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":["data-completion","data-science","dimensionality-reduction","machine-learning","matrix","nmtf"],"created_at":"2024-11-19T12:39:41.726Z","updated_at":"2025-05-15T12:31:27.360Z","avatar_url":"https://github.com/Advestis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![doc](https://img.shields.io/badge/-Documentation-blue)](https://advestis.github.io/adnmtf)\n[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n#### Status\n[![pytests](https://github.com/Advestis/adnmtf/actions/workflows/pull-request.yml/badge.svg)](https://github.com/Advestis/adnmtf/actions/workflows/pull-request.yml)\n[![push-pypi](https://github.com/Advestis/adnmtf/actions/workflows/push-pypi.yml/badge.svg)](https://github.com/Advestis/adnmtf/actions/workflows/push-pypi.yml)\n[![push-doc](https://github.com/Advestis/adnmtf/actions/workflows/push-doc.yml/badge.svg)](https://github.com/Advestis/adnmtf/actions/workflows/push-doc.yml)\n\n![maintained](https://img.shields.io/badge/Maintained%3F-yes-green.svg)\n![issues](https://img.shields.io/github/issues/Advestis/adnmtf.svg)\n![pr](https://img.shields.io/github/issues-pr/Advestis/adnmtf.svg)\n\n\n#### Compatibilities\n![ubuntu](https://img.shields.io/badge/Ubuntu-supported--tested-success)\n![windows](https://img.shields.io/badge/Windows-supported--tested-success)\n![unix](https://img.shields.io/badge/Other%20Unix-supported--untested-yellow)\n\n![python](https://img.shields.io/pypi/pyversions/adnmtf)\n\n\n##### Contact\n[![linkedin](https://img.shields.io/badge/LinkedIn-Advestis-blue)](https://www.linkedin.com/company/advestis/)\n[![linkedin2](https://img.shields.io/badge/LinkedIn-PFogel-blue)](https://www.linkedin.com/in/fogelpaul/)\n[![website](https://img.shields.io/badge/website-Advestis.com-blue)](https://www.advestis.com/)\n[![mail](https://img.shields.io/badge/mail-maintainers-blue)](mailto:pfogel@advestis.com)\n\n# NMTF\n\nNon-Negative Matrix and Tensor Factorizations\n\nDevelopped in collaboration with [Advestis](https://advestis.com/) ([Github](https://github.com/Advestis))\n\n## NMF Example\n\n```python\nfrom adnmtf import NMF\nimport numpy as np\n\nw = np.array([[1, 2],\n              [3, 4],\n              [5, 6],\n              [7, 8],\n              [9, 10],\n              [11, 12]])\n\nh = np.array([[0.1, 0.2, 0.3, 0.4, 0.5, 0.6],\n              [0.9, 0.8, 0.7, 0.6, 0.5, 0.4]])\nm0 = w.dot(h)\nmy_nmfmodel = NMF(n_components=2)\nestimator_ = my_nmfmodel.fit_transform(m0)\nestimator_ = my_nmfmodel.predict(estimator_)\n```\n\nIn this example, the matrix to be factorized is generated by the dot product of:\n\n| W  |    |\n|----|----|\n| 1  | 2  |\n| 3  | 4  |\n| 5  | 6  |\n| 7  | 8  |\n| 9  | 10 |\n| 11 | 12 |\nand\n\n| H   |     |     |     |     |     |\n|-----|-----|-----|-----|-----|-----|\n| 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 |\n| 0.9 | 0.8 | 0.7 | 0.6 | 0.4 | 0.4 |\n\n- *NMF* instantiates a NMF class with 2 components.\n- *fit_transform* calls the functions below in the given order:\n  - *nmtf_base* module: *non_negative_factorization*, *nmf_init*, *r_ntf_solve*\n  - *nmtf_core* module: *ntf_solve*, *ntf_solve_simple*, *ntf_update*\n- *predict* derives from *fit_transform* outputs ordered sample and\nfeature indexes for future use in ordered heatmaps. \n*predict* calls *nmf_predict* and *build_clusters* in the *nmtf_base* module\n\n## NTF Example\n\n```python\nfrom adnmtf import NTF\nimport pandas as pd\n\nDATA_PATH = ...\n\ndf = pd.read_csv(DATA_PATH)\nm0 = df.values\nn_blocks = 5\nmy_ntfmodel = NTF(n_components=5)\nestimator_ = my_ntfmodel.fit_transform(m0, n_blocks)\nestimator_ = my_ntfmodel.predict(estimator_)\n\n\n```\n\nIn this example, the tensor to be factorized is read in file *data_ntf.csv*. \nThe tensor has 5 layers in the 3rd dimension and is formatted as a table\nwith 5 blocks concatenated horizontally.\n\n- *NTF* instantiates a NTF class with 5 components.\n- *fit_transform* calls the functions below in the given order:\n  - *nmtf_base* module: *non_negative_tensor_factorization*, *ntf_init*, *r_ntf_solve*\n  - *nmtf_core* module: *ntf_solve*, *ntf_solve_simple*, *ntf_update*\n- *predict* derives from *fit_transform* outputs ordered sample and\nfeature indexes for future use in ordered heatmaps. \n*predict* calls *nmf_predict* and *build_clusters* in the *nmtf_base* module\n\n## Articles\n\n### Peer-reviewed articles\n\n* [(researchgate) A Tale of Two Matrix Factorizations](https://www.researchgate.net/publication/263216872_A_Tale_of_Two_Matrix_Factorizations)\n* [(researchgate) Fast Local Algorithms for Large Scale Nonnegative Matrix and Tensor Factorizations](https://www.researchgate.net/publication/220241471_Fast_Local_Algorithms_for_Large_Scale_Nonnegative_Matrix_and_Tensor_Factorizations)\n* [(nature) Learning the parts of objects by non-negative matrix factorization](https://www.nature.com/articles/44565)\n\n### Blog articles\n\n* [(Medium) Using Non-negative matrix factorization to classify companies](https://medium.com/@chtill.g/using-nmf-to-classify-companies-a77e176f276f)\n\n* [(offconvex) Tensor Methods in Machine Learning](https://www.offconvex.org/2015/12/17/tensor-decompositions/?source=post_page---------------------------)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadvestis%2Fadnmtf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadvestis%2Fadnmtf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadvestis%2Fadnmtf/lists"}