bkbncn / MatrixInverse

Python Code to Efficiently Inverse a Matrix

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Matrix Inverse

Matrix Inversion Logo

A step by step explanation of how to inverse a matrix using a jupyter notebook and python scripts.

The Jupyter notebooks walks thru a brute force procedural method for inverting a matrix with pure Python. Why wouldn’t we just use numpy? Great question. This work is about creating tools that add efficiency AND clarity. I love numpy, pandas, sklearn, and all the great tools that the python data science community brings to us, but I have learned that the better I understand the “innards” of a thing, the better I know how to apply it. Plus, tomorrow's machine learning tools will be developed by those that understand the "innards" of the math and coding of today’s tools.

Getting started

  1. DevelopmentNotebook.ipynb contains the brute force code used to illustrate the methods. DevelopmentNotebook.py is a python script version of DevelopmentNotebook.ipynb for those that do not use Jupyter notebooks.
  2. ODFDevNB.ipynb contains similar code to DevelopmentNotebook.ipynb but prints output in LibreOffice Math format to automate the illustrations of the matrix math. It also had a corresponding .py file.
  3. MatrixInversion3x3StepbyStep.txt is a detailed step-by-step explanation of the procedure, manually speaking, on a 3x3 matrix.
  4. MatrixInversion5x5StepbyStep.txt is a detailed step-by-step explanation of the procedure, manually speaking, on a 5x5 matrix.
  5. MatrixInverseStepByStep.ipynb is the programming used to create MatrixInversionXxXStepbyStep.txt, because I was TOO LAZY to have done all of the MatrixInversionXxXStepbyStep.txt work by hand! It has a corresponding .py file.
  6. MatrixInversion.ipynb is a Jupyter notebook that walks you through the inversion programming steps. There is a corresponding .py version.
  7. LinearAlgebraPurePython.py is a module file to be imported and have it's functions called in basic linear algebra work.
  8. LinearAlgebraPractice.py is a simple python script that imports LinearAlgebraPurePython.py and uses it's functions.
  9. ShortImplementation.py is an attempt to make the shortest piece of python code possible to invert a matrix with the methods explained. I don't recommend using it. The shortest code is RARELY the best code. I'm a fan of clarity and maintainability.

Deploying / Publishing

I would appreciate it, as you share your work leveraged from this set of scripts, if you would please keep a referral back to my github repo. Thanks! I'd do the same for you. :-)

Contributing

I am open to share the development and improvements of this with others, but it has been solo up until now. Let me know if you'd like to contribute.

Links

This work came from My GitHub Repo originally.

Licensing

"The code in this project is licensed under MIT license."

About

Python Code to Efficiently Inverse a Matrix

License:The Unlicense


Languages

Language:Jupyter Notebook 75.0%Language:Python 25.0%