Materials for a technical, nuts-and-bolts course about increasing transparency, fairness, robustness, and security in machine learning.
- Lecture 1: Explainable Machine Learning Models
 - Lecture 2: Post-hoc Explanation
 - Lecture 3: Bias Testing and Remediation
 - Lecture 4: Machine Learning Security
 - Lecture 5: Machine Learning Model Debugging
 - Lecture 6: Responsible Machine Learning Best Practices
 - Lecture 7: Risk Mitigation Proposals for Language Models
 
Corrections or suggestions? Please file a GitHub issue.
Source: Simple Explainable Boosting Machine Example
- Lecture Notes
 - Software Example
 - Assignment 1:
 - Reading: Machine Learning for High-Risk Applications, Chapter 2 (pp. 33 - 50) and Chapter 6 (pp. 189 - 217)
- Check availablity through GWU Libraries access to O'Reilly Safari
 
 - Lecture 1 Additional Materials
 
Source: Global and Local Explanations of a Constrained Model
- Lecture Notes
 - Software Example
 - Assignment 2
 - Reading: Machine Learning for High-Risk Applications, Chapter 2 (pp. 50 - 80) and Chapter 6 (pp. 208 - 230)
- Check availablity through GWU Libraries access to O'Reilly Safari
 
 - Lecture 2 Additional Materials
 
Source: Lecture 3 Notes
- Lecture Notes
 - Software Example
 - Assignment 3
 - Reading Machine Learning for High-Risk Applications, Chapter 4 and Chapter 10
- Check availablity through GWU Libraries access to O'Reilly Safari
 
 - Lecture 3 Additional Materials
 
Source: Responsible Machine Learning
- Lecture Notes
 - Software Examples:
 - Assignment 4
 - Reading: Machine Learning for High-Risk Applications, Chapter 5 and Chapter 11
 - Lecture 4 Additional Materials
 
Source: Real-World Strategies for Model Debugging
- Lecture Notes
 - Software Examples:
- Sensitivity Analysis:
 - Residual Analysis
 
 - Assignment 5
 - Reading: Machine Learning for High-Risk Applications, Chapter 3 and Chapter 8
- Check availablity through GWU Libraries access to O'Reilly Safari
 
 - Lecture 5 Additional Materials
 
A Responsible Machine Learning Workflow Diagram. Source: Information, 11(3) (March 2020).
- Lecture Notes
 - Assignment 6 (Final Assessment)
 - Reading: Machine Learning for High-Risk Applications, Chapter 1 and Chapter 12
 - Lecture 6 Additional Materials
 
A diagram for retrieval augmented generation. Source: Lecture 7 notes.
- Lecture Notes
 - Software Example
 - Reading: Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile, pgs. 1-12, 47-53
 - Lecture 7 Additional Materials
 
- 
Create a folder in your GWU Google Drive
My DrivecalledDNSC_6330_Software - 
To run the lecture examples:
- Create a folder named 
Lecture_01inside theDNSC_6330_Software - Save a copy of the class 
01_Explainable_AI_Models.ipynbnotebook into theLecture_01folder by using theFile->
Save a Copy In Drivemenu options, or download the class notebook and upload to your folder - In cell 1 of the 
01_Explainable_AI_Models.ipynbupdate the path to theLecture_01folder:- likely 
%cd drive/My\ Drive/DNSC_6330_Software/Lecture_01/ - Use the 
%cdand%lscommands to find your folder if needed - Generally the 
drive.mount('/content/drive/', force_remount=True)command can only be used once in a Colab session, so use%cdand%lscommands in a different cell or restart your colab session if you see strange errors 
 - likely 
 - Download the example data from: https://drive.google.com/drive/folders/1jYZvT1j5khFnJC5NSqNeGiCNoOeib9YK?usp=sharing (Click triangle beside 
Dataat top -> Download, then unzip and upload intoDNSC_6330_Softwarefolder) - Download some necessary Python code from: https://drive.google.com/drive/folders/1BPXxGp0QAKRl1ZP6Vd1xKuCwitiLyuy6?usp=sharing (Click triangle beside 
hrml_bookat top -> Download, then unzip and upload intoDNSC_6330_Softwarefolder) - Upload these folders into the 
DNSC_6330_Softwarefolder 
 - Create a folder named 
 - 
To run the homework templates:
- Create a folder called 
assignmentsin theDNSC_6330_Softwarefolder - Download then upload the notebook 
assign_1_template.ipynbinto theassignmentsfolder - Create a folder called 
datain theDNSC_6330_Softwarefolder - Download the assignment data from the class GitHub: https://github.com/jphall663/GWU_rml/tree/master/assignments/data
 - Unzip the data files into CSV files and upload them into the 
datafolder - In the 
assignment_1.ipynbadd a cell before cell 1 that installsh2oandinterpret:!pip install interpret h2o - In the 
assignment_1.ipynbadd a cell before cell 3 that connects the notebook to the data: 
 - Create a folder called 
 
from google.colab import drive
drive.mount('/content/drive/', force_remount=True)
# may need to be updated to location on your drive
%cd drive/My\ Drive/DNSC_6330_Software/assignments/
%ls
- Whenever asked, allow Colab to connect to your Google drive
 - Delete any 
__pycache__folders you see - In the end the 
DNSC_6330_Softwarefolder should look like: 
DNSC_6330_Software
├── assignments
│   ├── assign_1_template.ipynb
├── data
│   ├── hmda_test_preprocessed.csv
│   └── hmda_train_preprocessed.csv
├── Data
│   ├── backdoor_testing
│   │   ├── constrained_backdoor_output.csv
│   │   ├── constrained_output.csv
│   │   ├── overfit_backdoor_output.csv
│   │   ├── overfit_output.csv
│   │   └── test_data.csv
│   ├── credit_line_increase.csv
│   ├── data_dictionary.csv
│   └── synthetic_data.csv
├── hrml_book
│   ├── explain.py
│   └── partial_dep_ice.ipynb
└── Lecture_01
    └── 01_Explainable_AI_Models.ipynb
- You can use the following commands in a colab notebook to check your file structure:
 
from google.colab import drive
drive.mount('/content/drive/', force_remount=True)
# may need to be updated to location on your drive
%cd drive/My\ Drive/DNSC_6330_Software/
!apt-get -y install tree
! tree
- 
Add new assignment templates into the
assignmentsfolder - 
Add new code examples to
Lecture_XX/XX_notebook_name.iypnbfolders- For Lecture 2 that would be 
Lecture_02/02_Explainable_AI_Post_Hoc.ipynb 
 - For Lecture 2 that would be 
 - 
For Lecture 7:
- Click the Lecture 7 Software Example
 - Click the small triangle at the right of 
RAG_Exampleand clickDownload - Extract the downloaded zip file with a name like 
RAG_Example-20250428T160138Z-001.zipinto a folder with a name likeRAG_Example-20250428T160138Z-001 - Inside the 
RAG_Example-20250428T160138Z-001folder should be a folder namedRAG_Example, upload theRAG_Example-20250428T160138Z-001/RAG_Examplefolder to theDNSC_6330_Softwarefolder on your G-Drive - Click on the 
DNSC_6330_Software/RAG_Example/07_RAG_query.ipynbfile and open it with Colab - To run the last session notebook (
07_RAG_query.ipynb), you will need an access token from HuggingFace.co- Create a free Hugging Face account (https://huggingface.co/)
 - Generate an access token (Profile -> Access Tokens)
 - Preserve the text of the token somewhere secure, as you may not be able to see it again after it is granted
 - In the 
07_RAG_query.ipynbnotebook create a new secret (by clicking on the key icon on left) namedHF_TOKENand populated with the Hugging Face access token. Grant the notebook access to the secret by toggle the switch at left of the secret. 
 - At the top of the notebook, update the path to your 
DNSC_6330_softwarefolder, something similar to:%cd drive/My\ Drive/DNSC_6330_Software/RAG_Example - After adjusting these settings the notebook should run without errors
 
 

