Skip to content

Commit fdcf438

Browse files
committed
Small uipdates
1 parent 5527c89 commit fdcf438

File tree

3 files changed

+1906
-76
lines changed

3 files changed

+1906
-76
lines changed

cgt-nn-rev9.ipynb

Lines changed: 1889 additions & 71 deletions
Large diffs are not rendered by default.

cgtnnlib/datasets.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ def calculate_sha1(file_path):
6262
)
6363
else:
6464
print(f"File {file_path} exists and SHA1 matches, skipping download.")
65-
if columns is None:
65+
if features is None:
6666
return pd.read_csv(file_path)
6767
else:
68-
return pd.read_csv(file_path, header=None, names=columns)
68+
return pd.read_csv(file_path, header=None, names=features)
6969
else:
7070
print(f"Downloading {url} to {file_path}")
7171
urllib.request.urlretrieve(url, file_path)
@@ -76,10 +76,10 @@ def calculate_sha1(file_path):
7676
f"SHA1 mismatch for downloaded file: {file_path}. Expected {sha1}, got {downloaded_sha1}"
7777
)
7878

79-
if columns is None:
79+
if features is None:
8080
return pd.read_csv(file_path)
8181
else:
82-
return pd.read_csv(file_path, header=None, names=columns)
82+
return pd.read_csv(file_path, header=None, names=features)
8383

8484

8585
def download_pmlb(dataset_name: str) -> pd.DataFrame:
@@ -120,7 +120,7 @@ def download_pmlb(dataset_name: str) -> pd.DataFrame:
120120
url='https://raw.githubusercontent.com/mragpavank/car-evaluation-dataset/refs/heads/master/car_evaluation.csv',
121121
saved_name='car_evaluation.csv',
122122
sha1='985852bc1bb34d7cb3c192d6b8e7127cc743e176',
123-
columns=['buying', 'maint', 'doors', 'persons', 'lug_boot', 'safety', 'class'],
123+
features=['buying', 'maint', 'doors', 'persons', 'lug_boot', 'safety', 'class'],
124124
)),
125125
),
126126
Dataset(

doc/reT1.115.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Regarding Theorem 1.115 from the Seven Sketches
2+
3+
Strategic preorders<em>‼︎</em>
4+
5+
- $P$: preorder of strategies (e.g., ordered by risk)
6+
- $Q$: be a preorder of game states (e.g., ordered by payoff)
7+
- A function $f : P \to Q$ that finds the *best possible outcome* for a given strategy is **Left Adjoint**
8+
- Due to T1.115 this is equivalent to $f$ preserving **joins**
9+
- **Example:** being logical about "OR" choices, like "what's my best outcome if I can use strategy A *or* strategy B?"
10+
- A function $g: Q \to P$ that finds the **least risky strategy** required to **guarantee** a certain outcome is a **Right Adjoint**.
11+
- Due to T1.115, this is equivalent to $g$ preserving **meets**.
12+
- **Example**: being logical about "AND" requirements, like "what is the single safest strategy I must commit to if I want to guarantee I achieve an outcome of *at least* A **AND** an outcome of *at least* B?"

0 commit comments

Comments
 (0)