{"id":37076000,"url":"https://github.com/jerela/mola","last_synced_at":"2026-01-14T08:56:39.441Z","repository":{"id":195214017,"uuid":"691171000","full_name":"jerela/mola","owner":"jerela","description":"A Python library for matrix algebra","archived":false,"fork":false,"pushed_at":"2024-04-09T12:04:20.000Z","size":391,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T13:07:34.805Z","etag":null,"topics":["data-analysis","linear-algebra-library","matrix-algebra","python"],"latest_commit_sha":null,"homepage":"","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/jerela.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-09-13T16:32:28.000Z","updated_at":"2025-11-10T17:52:13.000Z","dependencies_parsed_at":"2023-12-02T11:23:08.457Z","dependency_job_id":"304cbad5-8958-4c3a-9e55-e8125485b9e0","html_url":"https://github.com/jerela/mola","commit_stats":null,"previous_names":["jerela/mola"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/jerela/mola","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerela%2Fmola","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerela%2Fmola/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerela%2Fmola/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerela%2Fmola/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jerela","download_url":"https://codeload.github.com/jerela/mola/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerela%2Fmola/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-analysis","linear-algebra-library","matrix-algebra","python"],"created_at":"2026-01-14T08:56:38.772Z","updated_at":"2026-01-14T08:56:39.426Z","avatar_url":"https://github.com/jerela.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Matrix operations and linear algebra (mola) library for core Python\n\n- [Introduction](#introduction)\n- [Getting started](#getting-started)\n- [Prerequisites](#prerequisites)\n- [Classes](#classes)\n  * [Matrix](#matrix)\n- [License](#license)\n\u003c!-- toc --\u003e\n\n## Introduction\n\n**mola** is a Python library for doing algebra with matrices. It covers the basic operations such as matrix addition and multiplication, transposes, and inverse. Additionally, it has some miscellaneous data analytical tools for regression, clustering etc. It is written without any external Python libraries.\n\nI wrote **mola** as a hobby project to remind myself of the linear algebra I studied in uni and to practice my Python programming. Particularly, this is an exercise in publishing my first Python library.\n\n## Getting started\n\nInstall with \"pip install mola\" or download the GitHub repository for a more recent version.\n\nSee main.py for examples and read the documentation.\n\n## Prerequisites\n\n- Python 3.x (written on Python 3.9, so that's sure to work)\n\n## Current features\n\n- basic matrix operations implemented (addition, multiplication, transpose, inverse)\n- matrices with labeled rows and columns\n- user-friendly wrappers for function fitting (including linear least squares regression, Tikhonov regularization, Gauss-Newton iteration for nonlinear fitting)\n- some basic matrix decompositions (QR decomposition and eigendecomposition)\n- clustering with hard k-means and fuzzy c-means and density-based clustering (see examples/visualize_clustering.py for a demonstration)\n\n\n![visualization of regression algorithms](https://github.com/jerela/mola/blob/master/examples/visualize_regression.png)\n![visualization of clustering algorithms](https://github.com/jerela/mola/blob/master/examples/visualize_clustering.png)\n\n## Classes\n\n### Matrix\n\n**Matrix** is the main class of **mola**. In practice, the elements of the matrix are implemented with lists. Most of its functionality involves calling methods from this class.\n\n### LabeledMatrix\n\n**LabeledMatrix** inherits **Matrix** and allows labeling of rows and columns, as well as overriding certain setter and getter functions to use those labels.\n\n## TODO:\n- checks to see if matrix is positive/negative definite/semidefinite\n- different matrix norms (only Frobenius and Euclidean norm implemented right now)\n- more decompositions (SVD)\n- user-friendly wrapper for logistic regression\n- preprocessing functions for matrix data (center and scale, e.g., z-scores)\n- example data analysis project to showcase existing features\n\n## License\n\n```\nMIT License\n\nCopyright (c) 2023 Jere Lavikainen\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerela%2Fmola","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjerela%2Fmola","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerela%2Fmola/lists"}