Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ML in Python — with a Coding Agent (Lesson 1)

A single-lesson intro to machine learning in Python. We build a text sentiment classifier with scikit-learn, then hand the notebook to a coding agent (Codex or Claude Code) to extend it.

What's here

Notebook Task Format
notebooks/01_sentiment_analysis_beer.ipynb Beer review sentiment (3-class) Manual build + two agent demos
notebooks/02_nli_exercise.ipynb Natural language inference (binary) Exercise
notebooks/03_sentiment_analysis_wine.ipynb Wine review sentiment (3-class) Exercise

Slides: slides/Tutorial1_Slides-ML_in_Python.pdf

Running the notebooks

Download a notebook and open it in Google Colab (File → Upload notebook), or run it locally with Jupyter. Each notebook downloads its own data with wget, so nothing else needs to be set up.

For local runs: pip install -r requirements.txt.

The beer notebook (main lesson)

  1. Manually build a bag-of-words sentiment classifier (load → inspect → naive baseline → features → models → interpret).
  2. Agent demo A — ask the agent to plot learning curves that show overfitting.
  3. Agent demo B — ask the agent to iteratively improve the model (an "auto-research" loop) without touching the test set.

The NLI and wine notebooks are exercises that reuse the same workflow.

For the agent demos: once the manual part is done, download the notebook and drop it into a desktop agent session (e.g. the Claude or ChatGPT desktop app), then paste the prompts from the notebook — first Part A, then Part B. The agent runs the code and the plots come back as artifacts in the app.

Data

  • data/beer/ — beer reviews, 3-class (20k / 5k / 5k).
  • data/nli/ — MNLI subset, binary entailment vs. contradiction.
  • data/wine/Wine Enthusiast reviews, 80–100 points bucketed to 3 classes (20k / 5k / 5k). See data/wine/README.md for provenance.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages