Project for open sourcing research efforts on Backward Compatibility in Machine Learning
Перейти к файлу
Nicholas King 47f5b3f893
Test setup (#30)
* First experiments in setting up test framework

* Basic React widget test passing

* Jest setup in package.json. Move tests to their own folder.

* Remove jest.config.ts

* Basic DataSelector test

* Remove sum.js used in testing test setup

* Configure ts-jest

* Rename main test file

* Added test for 'select all' checkboxes in DataSelector

* Remove unnecessary code

* Add UI test info to the Readme

Co-authored-by: Nicholas King <v-nicki@microsoft.com>
2020-11-13 12:21:07 -08:00
.vscode Decouple dev workflow from Jupyter, create hot debugging environment (#25) 2020-11-13 12:21:07 -08:00
backwardcompatibilityml Decouple dev workflow from Jupyter, create hot debugging environment (#25) 2020-11-13 12:21:07 -08:00
development Decouple dev workflow from Jupyter, create hot debugging environment (#25) 2020-11-13 12:21:07 -08:00
docs BackwardCompatibilityML v1.1.0 release (#21) 2020-10-10 00:21:46 +03:00
examples Display error counts as well as percentages within the Venn diagram (#24) 2020-11-13 12:21:06 -08:00
tests Test setup (#30) 2020-11-13 12:21:07 -08:00
widget Test setup (#30) 2020-11-13 12:21:07 -08:00
.flake8 Decouple dev workflow from Jupyter, create hot debugging environment (#25) 2020-11-13 12:21:07 -08:00
.flaskenv Decouple dev workflow from Jupyter, create hot debugging environment (#25) 2020-11-13 12:21:07 -08:00
.gitignore Decouple dev workflow from Jupyter, create hot debugging environment (#25) 2020-11-13 12:21:07 -08:00
CONTRIBUTING.md BackwardCompatibilityML v1.0.0 open source release 2020-09-10 21:16:46 +02:00
LICENSE.txt BackwardCompatibilityML v1.0.0 open source release 2020-09-10 21:16:46 +02:00
README.md Test setup (#30) 2020-11-13 12:21:07 -08:00
SECURITY.md BackwardCompatibilityML v1.0.0 open source release 2020-09-10 21:16:46 +02:00
dev-requirements.txt Decouple dev workflow from Jupyter, create hot debugging environment (#25) 2020-11-13 12:21:07 -08:00
example-requirements.txt BackwardCompatibilityML v1.1.0 release (#21) 2020-10-10 00:21:46 +03:00
jest.config.js Test setup (#30) 2020-11-13 12:21:07 -08:00
package.json Test setup (#30) 2020-11-13 12:21:07 -08:00
release.sh Decouple dev workflow from Jupyter, create hot debugging environment (#25) 2020-11-13 12:21:07 -08:00
requirements.txt BackwardCompatibilityML v1.0.0 open source release 2020-09-10 21:16:46 +02:00
setup.py BackwardCompatibilityML v1.1.0 release (#21) 2020-10-10 00:21:46 +03:00
tsconfig.json Test setup (#30) 2020-11-13 12:21:07 -08:00
webpack.config.js Decouple dev workflow from Jupyter, create hot debugging environment (#25) 2020-11-13 12:21:07 -08:00

README.md

Introduction

Updates that may improve an AI systems accuracy can also introduce new and unanticipated errors that damage user trust. Updates that introduce new errors can also break trust between software components and machine learning models, as these errors are propagated and compounded throughout larger integrated AI systems. The Backward Compatibility ML library is an open-source project for evaluating AI system updates in a new way for increasing system reliability and human trust in AI predictions for actions.

The Backward Compatibility ML project has two components:

  • A series of loss functions in which users can vary the weight assigned to the dissonance factor and explore performance/capability tradeoffs during machine learning optimization.

  • Visualization widgets that help users examine metrics and error data in detail. They provide a view of error intersections between models and incompatibility distribution across classes.

Getting Started

  1. Setup a Python virtual environment or Conda environment and activate it.
  2. From within the root folder of this project do pip install -r requirements.txt
  3. From within the root folder do npm install
  4. From within the root folder of this project do npm run build && pip install -e . or NODE_ENV=production npx webpack && pip install -e .
  5. You should now be able to import the backwardcompatibilityml module and use it.

Examples

Start your Jupyter Notebooks server and load in the example notebook under the examples folder to see how the backwardcompatibilityml module is used.

To demo the widget, open the notebook compatibility-analysis.ipynb.

Tests

To run tests, make sure that you are in the project root folder and do:

  1. pip install -r dev-requirements.txt
  2. pytest tests/
  3. npm install
  4. npm run test

Development environment

To run the widget and APIs in a development environment:

  • Open a new terminal, then from within the root folder do npm start. This will host the widget with webpack-dev-server.
    • To customize the host IP, run webpack-dev-server --hot --mode development --host <ip> instead of npm start.
    • npm start uses 0.0.0.0 which makes the server accessible externally.
  • Open a new terminal, then from within the root folder do flask run. This will start the Flask server for the APIs used by the widget.

The widget can be loaded in the web browser at localhost:3000. It will be loaded independently from a Jupyter notebook. The APIs will be hosted at localhost:5000. If you are running the server within a VM, you might need to use your machine's local IP instead of localhost.

Changes to the CSS or TypeScript code will be hot loaded automatically in the browser. Flask will run in debug mode and automatically restart whenever the Python code is changed.

Contributing

Check CONTRIBUTING page.

Research and Acknowledgements

This project materializes and implements ideas from ongoing research on Backward Compatibility in Machine Learning and Model Comparison. Here is a list of development and research contributors:

Current Project Leads: Xavier Fernandes, Juan Lema, Besmira Nushi

Research Contributors: Gagan Bansal, Megha Srivastava, Besmira Nushi, Ece Kamar, Eric Horvitz, Dan Weld, Shital Shah

References

"Updates in Human-AI Teams: Understanding and Addressing the Performance/Compatibility Tradeoff." Gagan Bansal, Besmira Nushi, Ece Kamar, Daniel S Weld, Walter S Lasecki, Eric Horvitz; AAAI 2019. Pdf

@inproceedings{bansal2019updates,
  title={Updates in human-ai teams: Understanding and addressing the performance/compatibility tradeoff},
  author={Bansal, Gagan and Nushi, Besmira and Kamar, Ece and Weld, Daniel S and Lasecki, Walter S and Horvitz, Eric},
  booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
  volume={33},
  pages={2429--2437},
  year={2019}
}

"An Empirical Analysis of Backward Compatibility in Machine Learning Systems." Megha Srivastava, Besmira Nushi, Ece Kamar, Shital Shah, Eric Horvitz; KDD 2020. Pdf

@inproceedings{srivastava2020empirical,
  title={An Empirical Analysis of Backward Compatibility in Machine Learning Systems},
  author={Srivastava, Megha and Nushi, Besmira and Kamar, Ece and Shah, Shital and Horvitz, Eric},
  booktitle={Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery \& Data Mining},
  pages={3272--3280},
  year={2020}
}

"Towards Accountable AI: Hybrid Human-Machine Analyses for Characterizing System Failure." Besmira Nushi, Ece Kamar, Eric Horvitz; HCOMP 2018. Pdf

@article{nushi2018towards,
  title={Towards accountable ai: Hybrid human-machine analyses for characterizing system failure},
  author={Nushi, Besmira and Kamar, Ece and Horvitz, Eric},
  journal={ Proceedings of the Sixth AAAI Conference on Human Computation and
               Crowdsourcing},
  pages = {126--135},
  year={2018}
}

Microsoft Open Source Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

License

This project is licensed under the terms of the MIT license. See LICENSE.txt for additional details.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.