flowchart LR P[Prompt] --> C[AI writes code] C --> R[Run code] R --> T[Unit tests] T -->|pass| K[Keep] T -->|fail| F[Fix and rerun] F --> C
Day 2 - Block 4
The hottest new programming language is English
— Andrej Karpathy ((karpathy?)) January 24, 2023
Open source is powerful
AI can edit the code of the tool!
Get comfortable with markdown
Language that AI uses!
Get comfortable in the terminal
simple, scriptable!
.do files and comments
import numpy as np
def ols_beta(X, y):
...
def test_ols_function():
x = np.array([1, 2, 3, 4])
X = np.column_stack([np.ones(len(x)), x])
y = 2 + 3 * x # true model
beta_hat = ols_beta(X, y)
assert np.allclose(beta_hat, [2.0, 3.0], atol=1e-10)Write these yourself or in separate AI session!
flowchart LR P[Prompt] --> C[AI writes code] C --> R[Run code] R --> T[Unit tests] T -->|pass| K[Keep] T -->|fail| F[Fix and rerun] F --> C
Write code to solve tasks!
flowchart LR D[SPSS raw data] -->|hidden| X[No direct model access] M[Metadata: columns labels scales types] --> A[Agent writes analysis code] A --> H[Human runs code locally] H --> O[Verified output]
TI Workshop | D2 B4