AI for Data & Documents · Part I · Structured data
Topic 2

Modeling and Code You Can Trust

Have AI write and explain the code for a linear regression and a regression tree (CART) predicting the numeric outcome Y1. The emphasis is on prompting for reproducible, verifiable code — split the data by time, treat region (X20) as categorical, and judge each model by its RMSE against the standard deviation of Y1 — an analysis you can defend, not a black box.

Open Claude Download prompts (.txt) Regression Regression Trees (CART)
1

Download a GOV dataset (GOV1–GOV23) + its description from GOV Datasets.

2

Open Claude in a new tab and upload the CSV.

3

Run Part A (regression), then Part B (CART), then the head-to-head.

4

Fill in the Results Log: compare each test RMSE to the std. dev. of Y1.

Topic slidesDownload the slides for this topic (PDF)

Prompts to copyCopy one, paste it into Claude with your dataset (CSV) attached

Run it in Claude

  • 1. Download a GOV dataset (CSV) from the GOV Datasets page.
  • 2. Open Claude and start a new chat; attach the CSV.
  • 3. Run Part A, then Part B, then the comparison prompts.
  • 4. A useful model has RMSE clearly below the std. dev. of Y1.
Open Claude in a new tab

Tip: put the two tabs side by side so you can copy here and paste there without losing your place.