VoltageVagabond commited on
Commit
542a166
·
verified ·
1 Parent(s): 4617d12

Update notebooks and project files

Browse files
.hfignore ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ CLAUDE.md
2
+ .claude/
3
+ docs/superpowers/
4
+ _git_history_archive.txt
launch-app.command ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ cd "$(dirname "$0")"
3
+
4
+ if [ -d "venv" ]; then
5
+ source venv/bin/activate
6
+ elif [ -d "../spam-xai-project/venv" ]; then
7
+ source ../spam-xai-project/venv/bin/activate
8
+ fi
9
+
10
+ echo "Starting Streamlit app..."
11
+ echo "Open http://localhost:8501 in your browser"
12
+ echo ""
13
+ streamlit run app.py
launch-gradio.command ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ # Double-click this file in Finder to launch the Spam Classifier UI
3
+ cd "$(dirname "$0")"
4
+
5
+ if [ -d "venv" ]; then
6
+ source venv/bin/activate
7
+ fi
8
+
9
+ echo "Starting Spam Classifier..."
10
+ echo "Opening http://127.0.0.1:7860 in your browser..."
11
+ sleep 2 && open http://127.0.0.1:7860 &
12
+ python3.11 app.py
launch-notebook.command ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ # Double-click this file in Finder to open the student teaching notebook
3
+ # (the main turn-in artifact for the course).
4
+ cd "$(dirname "$0")"
5
+
6
+ if [ -d "venv" ]; then
7
+ source venv/bin/activate
8
+ fi
9
+
10
+ python3.11 -m pip install jupyter wordcloud -q 2>/dev/null
11
+ echo "Opening student notebook..."
12
+ python3.11 -m jupyter notebook notebooks/spam_classifier_xai_student.ipynb
retrain.command ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ cd "$(dirname "$0")"
3
+
4
+ # Check for venv, create if needed
5
+ if [ -d "venv" ]; then
6
+ source venv/bin/activate
7
+ else
8
+ echo "No venv found. Creating one..."
9
+ python3 -m venv venv
10
+ source venv/bin/activate
11
+ pip install -r requirements.txt
12
+ fi
13
+
14
+ echo "============================================================"
15
+ echo " Spam XAI Project — Retrain Random Forest classifier"
16
+ echo " Features: 3000 TF-IDF + 11 metadata features"
17
+ echo " Data: SpamAssassin + Enron + newsletters"
18
+ echo " Time: ~5-10 minutes"
19
+ echo " Saves: models/ (random_forest_spam.joblib, etc.)"
20
+ echo "============================================================"
21
+ echo ""
22
+ python3 retrain.py
23
+ echo ""
24
+ echo "Done! Models saved to models/"
25
+ echo ""
26
+ echo "Press any key to close..."
27
+ read -n 1