Package: pytorch-lattice
Getting Started with PyTorch LatticeA PyTorch implementation of constrained optimization and modeling techniquesTransparent Models: Glassbox models to provide increased interpretability and insights into your ML models.Shape Constraints: Embed domain knowledge directly into the model through feature constraints.Rate Constraints (Coming soon...): Optimize any PyTorch model under a set of constraints on rates (e.g. FPR < 1%). Rates can be calculated both for the entire dataset as well as specific slices.InstallationInstall PyTorch Lattice and start training and analyzing calibrated models in minutes.$pipinstallpytorch-latticeQuickstartStep 1. Import the packageFirst, import the PyTorch Lattice library:importpytorch_latticeaspylStep 2. Load data and fit a classifierLoad the UCI Statlog (Heart) dataset. Then create a base classifier and fit it to the data. Creating the base classifier requires only the feature names.X,y=pyl.datasets.heart()clf=pyl.Classifier(X.columns).fit(X,y)Step 3. Plot a feature calibratorNow that you've trained a classifier, you can plot the feature calibrators to better understand how the model is understanding each feature.pyl.plots.calibrator(clf.model,"thal")Step 4. What's Next?Check out theConceptssection to dive deeper into the library and the core features that make it powerful, such ascalibratorsandshape constraints.You can follow along with more detailedwalkthroughsto get a better understanding of how to utilize the library to effectively model your data. You can also take a look atcode examplesin the repo.TheAPI Referencecontains full details on all classes, methods, functions, etc.Related ResearchMonotonic Kronecker-Factored Lattice, William Taylor Bakst, Nobuyuki Morioka, Erez Louidor, International Conference on Learning Representations (ICLR), 2021Multidimensional Shape Constraints, Maya Gupta, Erez Louidor, Oleksandr Mangylov, Nobu Morioka, Taman Narayan, Sen Zhao, Proceedings of the 37th International Conference on Machine Learning (PMLR), 2020Deontological Ethics By Monotonicity Shape Constraints, Serena Wang, Maya Gupta, International Conference on Artificial Intelligence and Statistics (AISTATS), 2020Shape Constraints for Set Functions, Andrew Cotter, Maya Gupta, H. Jiang, Erez Louidor, Jim Muller, Taman Narayan, Serena Wang, Tao Zhu. International Conference on Machine Learning (ICML), 2019Diminishing Returns Shape Constraints for Interpretability and Regularization, Maya Gupta, Dara Bahri, Andrew Cotter, Kevin Canini, Advances in Neural Information Processing Systems (NeurIPS), 2018Deep Lattice Networks and Partial Monotonic Functions, Seungil You, Kevin Canini, David Ding, Jan Pfeifer, Maya R. Gupta, Advances in Neural Information Processing Systems (NeurIPS), 2017Fast and Flexible Monotonic Functions with Ensembles of Lattices, Mahdi Milani Fard, Kevin Canini, Andrew Cotter, Jan Pfeifer, Maya Gupta, Advances in Neural Information Processing Systems (NeurIPS), 2016Monotonic Calibrated Interpolated Look-Up Tables, Maya Gupta, Andrew Cotter, Jan Pfeifer, Konstantin Voevodski, Kevin Canini, Alexander Mangylov, Wojciech Moczydlowski, Alexander van Esbroeck, Journal of Machine Learning Research (JMLR), 2016Optimized Regression for Efficient Function Evaluation, Eric Garcia, Raman Arora, Maya R. Gupta, IEEE Transactions on Image Processing, 2012Lattice Regression, Eric Garcia, Maya Gupta, Advances in Neural Information Processing Systems (NeurIPS), 2009ContributingPyTorch Lattice welcomes contributions from the community! See thecontribution guidefor more information on the development workflow. For bugs and feature requests, visit ourGitHub Issuesand check out ourtemplates.How To HelpAny and all help is greatly appreciated! Check out our page onhow you can help.RoadmapCheck out the ourroadmapto see what's planned. If there's an item that you really want that isn't assigned or in progress, take a stab at it!VersioningPyTorch Lattice usesSemantic Versioning.LicenseThis project is licensed under the terms of theMIT License.