Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
075e1fb
add nature reporting summary
paxtonfitzpatrick Apr 1, 2023
243c172
add editorial policy checklist
paxtonfitzpatrick Apr 1, 2023
6901666
add software policy checklist
paxtonfitzpatrick Apr 1, 2023
0ae59c6
minor wording update to reporting summary
paxtonfitzpatrick Apr 1, 2023
5ff806e
Merge pull request #85 from paxtonfitzpatrick/master
paxtonfitzpatrick Oct 8, 2023
5fc0cc0
cross-lecture knowledge predictions, expanded version of figure
paxtonfitzpatrick Oct 8, 2023
08586e8
Merge branch 'revision-1' of https://github.com/ContextLab/efficient-…
paxtonfitzpatrick Oct 8, 2023
74dad9b
expanded version of fig 6
paxtonfitzpatrick Oct 8, 2023
fc1320e
WIP new knowledge smoothness analysis and figure
paxtonfitzpatrick Oct 8, 2023
281287c
fixed a couple docstring inconsistencies
paxtonfitzpatrick Oct 10, 2023
6c6b19a
better handling for raw pcorrect
paxtonfitzpatrick Oct 11, 2023
99b1ce6
updated code for bootstrapping p(correct) intersections
paxtonfitzpatrick Oct 12, 2023
bac2f2a
WIP knowledge smoothness fig
paxtonfitzpatrick Oct 12, 2023
8850c56
full knowledge smoothness analysis notebook, increased distance sampl…
paxtonfitzpatrick Oct 13, 2023
73ec800
new knowledge smoothness figure
paxtonfitzpatrick Oct 13, 2023
b1e07cd
updated figure layout, cleaned up code
paxtonfitzpatrick Oct 13, 2023
cd00d27
added lecture and question text in a pickle file
jeremymanning Oct 15, 2023
31336ef
WIP notebook comparing topic vector similarity to raw word count overlap
paxtonfitzpatrick Oct 16, 2023
a8a2c70
add within-lecture predictions to figure
paxtonfitzpatrick Oct 18, 2023
16412b8
remove knowledge smoothness notebook
paxtonfitzpatrick Oct 18, 2023
398b1e1
tweak figure 6 layout
paxtonfitzpatrick Oct 18, 2023
382a5d4
fix U stat in panel 12, add arrow to indicate distribution with great…
paxtonfitzpatrick Oct 19, 2023
916c43a
fixed a few typos in docstrings
paxtonfitzpatrick Oct 19, 2023
b1c294c
Merge branch 'master' of https://github.com/ContextLab/efficient-lear…
paxtonfitzpatrick Oct 19, 2023
de0ba8e
remove old version of fig 6
paxtonfitzpatrick Oct 19, 2023
e112740
add notebook for new knowledge smoothness fig, re-number other notebo…
paxtonfitzpatrick Oct 19, 2023
9b494f6
udpate notebooks README with new notebook, fix relative link to paper
paxtonfitzpatrick Oct 19, 2023
870b006
Merge pull request #87 from paxtonfitzpatrick/master
paxtonfitzpatrick Oct 19, 2023
f2e5346
tweaked figure appearance, font sizes, etc.
paxtonfitzpatrick Oct 20, 2023
a1a36dd
cleaned up new figures, added new fig 7, recompiled pdf with new vers…
paxtonfitzpatrick Oct 20, 2023
fba75e2
fixed unequal size and spacing of dots in fig 2A
paxtonfitzpatrick Oct 20, 2023
2982e96
fixed non-LaTeX quotes in supp table 1
paxtonfitzpatrick Oct 20, 2023
9987dde
Merge branch 'revision-1' of https://github.com/ContextLab/efficient-…
jeremymanning Oct 20, 2023
574ef99
consistent \hlines in tables
paxtonfitzpatrick Oct 20, 2023
44b9a24
recompiled pdf
paxtonfitzpatrick Oct 20, 2023
2a3b6f8
Merge pull request #88 from paxtonfitzpatrick/master
paxtonfitzpatrick Oct 20, 2023
87d146e
adjust fig 6 subplot spacing and alignment, remove overlapping x-axis…
paxtonfitzpatrick Oct 20, 2023
82da02b
vertically condense fig 6, recompile with updated version
paxtonfitzpatrick Oct 20, 2023
62f48ec
Merge pull request #89 from paxtonfitzpatrick/master
paxtonfitzpatrick Oct 20, 2023
9300cde
added in response letter figs
jeremymanning Oct 21, 2023
90563f3
add new supplementary table with question/lecture matched text
paxtonfitzpatrick Oct 22, 2023
b2efe95
code for new supplementary table
paxtonfitzpatrick Oct 22, 2023
6e86ec0
tweak latex output formatting for tables
paxtonfitzpatrick Oct 22, 2023
dbe023d
add pydata-wrangler with huggingface reqs to analysis environment
paxtonfitzpatrick Oct 22, 2023
b87524a
lecture sliding windows without preprocessing for LLM analyses
paxtonfitzpatrick Oct 22, 2023
08a6403
remove pydata-wrangler and transformers from container -- going to be…
paxtonfitzpatrick Oct 22, 2023
0119f50
merged in changes from contextlab revision-1 branch
jeremymanning Oct 22, 2023
6b66f27
remove dataframe index from table
paxtonfitzpatrick Oct 22, 2023
0e34162
WIP notebook comparing LDA and BERT embeddings
paxtonfitzpatrick Oct 22, 2023
af2fb46
BERT embeddings for lectures and quiz questions
paxtonfitzpatrick Oct 22, 2023
0e5a212
recompiled (I don't think there are any changes here)
paxtonfitzpatrick Oct 22, 2023
740d45b
Merge pull request #90 from paxtonfitzpatrick/master
paxtonfitzpatrick Oct 22, 2023
65a9a5e
Merge branch 'revision-1' of https://github.com/ContextLab/efficient-…
jeremymanning Oct 22, 2023
189b50a
text reflow
jeremymanning Oct 22, 2023
4a0e8ac
working on integrating edits to address reviewer comments
jeremymanning Oct 22, 2023
83a6f36
Merge pull request #91 from jeremymanning/master
jeremymanning Oct 22, 2023
6d49c56
removing redundant pickle file
jeremymanning Oct 22, 2023
2080215
Merge pull request #92 from jeremymanning/master
jeremymanning Oct 22, 2023
aeac5f1
code to generate model comparison supp fig
paxtonfitzpatrick Oct 22, 2023
b5181bc
individual components of model comparison figure
paxtonfitzpatrick Oct 22, 2023
855658d
added shared legends for qcorrs figs
paxtonfitzpatrick Oct 22, 2023
15f3211
remove shared legends, use qcorrs legends like the main text figure
paxtonfitzpatrick Oct 22, 2023
5449a46
assembled model comparison fig
paxtonfitzpatrick Oct 22, 2023
9698751
added BERT comparison figure to supplement
paxtonfitzpatrick Oct 22, 2023
420f72f
put notebook in paper order, renumbered subsequent notebooks accordingly
paxtonfitzpatrick Oct 22, 2023
75678f5
save out peak intervals of correlation timeseries
paxtonfitzpatrick Oct 23, 2023
78121e3
convert to ints for indexing
paxtonfitzpatrick Oct 23, 2023
3a771e8
notebook for plotting lecture-question correlation timeseries peaks
paxtonfitzpatrick Oct 23, 2023
f4272d4
new supplementary figs 3 & 4
paxtonfitzpatrick Oct 23, 2023
aaec75b
match color palette for questions to other figures, add figure title
paxtonfitzpatrick Oct 23, 2023
fe44b4a
numbered new supp fig notebook by paper order, renumbered others acco…
paxtonfitzpatrick Oct 23, 2023
869d76a
add new notebooks to notebook README
paxtonfitzpatrick Oct 23, 2023
b6b377f
pull submodule updates to fix out of sync head
paxtonfitzpatrick Oct 23, 2023
d141771
Merge pull request #93 from paxtonfitzpatrick/master
paxtonfitzpatrick Oct 23, 2023
bfa097d
code for comparing topic vector correlation vs simple word overlap
paxtonfitzpatrick Oct 23, 2023
9bc25ab
components for new supplemental fig
paxtonfitzpatrick Oct 23, 2023
85df677
caught some missing ellipses in supp tab 3
paxtonfitzpatrick Oct 23, 2023
409a4f5
WIP version of new supp fig 5
paxtonfitzpatrick Oct 23, 2023
5020e13
Merge pull request #94 from paxtonfitzpatrick/master
paxtonfitzpatrick Oct 23, 2023
ca28229
removed hidden artboard with duplicates
paxtonfitzpatrick Oct 23, 2023
171774e
replaced LDA vs BERT fig in response letter with new supp fig from paper
paxtonfitzpatrick Oct 23, 2023
6564db1
merge jeremy's edits locally
paxtonfitzpatrick Oct 23, 2023
98b1e07
backing up changes:
jeremymanning Oct 23, 2023
8dd6f11
backing up progress (working on addressing R2 comments)
jeremymanning Oct 23, 2023
3f901e8
complete draft of responses to all reviewer comments!
jeremymanning Oct 24, 2023
e61fbc6
filled in supplemental materials captions, updated word overlap compa…
jeremymanning Oct 24, 2023
10b05f8
change y-axis labels to lecture names instead of numbers
paxtonfitzpatrick Oct 24, 2023
621c243
merge paper edits from jeremy's fork
paxtonfitzpatrick Oct 24, 2023
c01f9fd
another round of JRM edits + spell checking, formatting edits, etc.
jeremymanning Oct 24, 2023
c1a99cf
incorporated PCF's suggested modification to k-selection text
jeremymanning Oct 24, 2023
e4e05a6
re-compiling changes doc
jeremymanning Oct 24, 2023
555d6a7
Merge branch 'master' of https://github.com/jeremymanning/efficient-l…
paxtonfitzpatrick Oct 24, 2023
67ce370
finished a round of edits to the supplement
jeremymanning Oct 24, 2023
8f43046
edits through intro
paxtonfitzpatrick Oct 24, 2023
ac1496f
dealing with misc editorial requests
jeremymanning Oct 24, 2023
c1f6459
updated editorial policy checklist and reporting summary, also split …
jeremymanning Oct 24, 2023
0d5db88
reworked 'understanding' statement
paxtonfitzpatrick Oct 24, 2023
7111b37
U with no tail
jeremymanning Oct 24, 2023
b774e4f
standardized phrasing of lecture 1 title
paxtonfitzpatrick Oct 24, 2023
1e44a6e
Merge branch 'master' of https://github.com/paxtonfitzpatrick/efficie…
jeremymanning Oct 24, 2023
2c1dccd
merge changes from jeremy's fork
paxtonfitzpatrick Oct 24, 2023
2b29e80
merge compiled pdf
paxtonfitzpatrick Oct 24, 2023
b6a9a63
added some explanatory text for the predictions analyses; also update…
jeremymanning Oct 24, 2023
0196d3c
merge edits from jeremy's fork
paxtonfitzpatrick Oct 24, 2023
46ecd74
edits through pdf line 345, source line 660
paxtonfitzpatrick Oct 24, 2023
5d05fa1
adding some wording tweaks discussed via slack
jeremymanning Oct 24, 2023
74a673c
edits through pdf line 364, source line 686
paxtonfitzpatrick Oct 25, 2023
317ed98
Merge branch 'master' of https://github.com/paxtonfitzpatrick/efficie…
jeremymanning Oct 25, 2023
b19ab0d
udpated knowledge map figures
jeremymanning Oct 25, 2023
01f19b2
working through issues discussed on slack + updated changes doc
jeremymanning Oct 25, 2023
88c1a47
cha cha cha changes.....
jeremymanning Oct 25, 2023
e186603
more slack discussion-inspired changes-- updating description of putt…
jeremymanning Oct 25, 2023
acab2d2
forgot to commit main.tex/main.pdf
jeremymanning Oct 25, 2023
1a721ab
recompiled supplement
jeremymanning Oct 25, 2023
43e0903
(hopefully) last round of edits from JRM
jeremymanning Oct 25, 2023
25fe0ef
added knowledge smoothness analyses description
paxtonfitzpatrick Oct 25, 2023
8640053
fix table 2 caption
paxtonfitzpatrick Oct 25, 2023
3470284
"supplemental" --> "supplementary"
paxtonfitzpatrick Oct 25, 2023
eded4f7
cleaned up supplement
paxtonfitzpatrick Oct 25, 2023
3d72fc4
Merge pull request #95 from paxtonfitzpatrick/master
paxtonfitzpatrick Oct 25, 2023
2da6d0d
add revision-1 cover letter, response letter, and diff
paxtonfitzpatrick Oct 25, 2023
f106cc2
Merge pull request #96 from paxtonfitzpatrick/master
paxtonfitzpatrick Oct 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ paper/**/*.out
paper/**/*.synctex.gz
paper/**/*.blg
paper/**/*.bbl
texput.log
16 changes: 9 additions & 7 deletions code/khan_helpers/khan_helpers/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def corr_mean(rs, axis=None, fix_inf=False, **kwargs):
Axis or axes along which the means are computed. If `None`
(default), the mean of the flattened array is computed.
fix_inf : bool, optional
See `z2r()` docstring for details. Default: False.
See `r2z()` docstring for details. Default: False.
**kwargs : various types, optional
Additional keyword arguments passed to `numpy.nanmean` (see
https://numpy.org/doc/stable/reference/generated/numpy.nanmean.html
Expand Down Expand Up @@ -622,7 +622,7 @@ def preprocess_text(textlist, correction_counter=None):
POS tagging, and lemmatization.

Occasionally, the Treebank POS tagger mis-tags a word, which causes
WordNet's "Morphy" to apply the morphologocal transformations and
WordNet's "Morphy" to apply the morphological transformations and
detachment rules for the wrong syntactic category, and fail to
lemmatize the word. The function attempts to handle these
instances and can optionally record corrections made this way for
Expand Down Expand Up @@ -683,7 +683,7 @@ def preprocess_text(textlist, correction_counter=None):
# to original chunk
chunk_delimiter = 'chunkdelimiter'
processed_chunks = [[] for _ in textlist]
# clean spacing, normalize case, strip puncutation
# clean spacing, normalize case, strip punctuation
# (temporarily leave punctuation useful for POS tagging)
full_text = f' {chunk_delimiter} '.join(textlist).lower()
punc_stripped = re.sub("[^a-zA-Z\s']+", '', full_text.replace('-', ' '))
Expand Down Expand Up @@ -783,7 +783,7 @@ def rbf_sum(obs_coords, pred_coords, width, metric='euclidean'):
width : scalar
The Width of the Gaussian kernel.
metric : str or callable, optional
The metric used to compute the pairwise distance between
The metric used to compute the pairwise distances between
coordinates (default: `'euclidean'`, Euclidean distance). May be
any named metric accepted by `scipy.spatial.distance.cdist` or a
callable that takes two `array_like` arguments.
Expand All @@ -806,14 +806,14 @@ def reconstruct_trace(lecture, questions, accuracy):

Parameters
----------
lecture: numpy.ndarray
lecture : numpy.ndarray
`(n_coordinates, n_features)` matrix of coordinates for which to
estimate knowledge.
questions: numpy.ndarray
questions : numpy.ndarray
`(n_observations, n_features)` matrix of coordinates for the
quiz questions used to estimate knowledge for each of the
`n_coordinates` locations.
accuracy: array_like
accuracy : array_like
`(n_observations,)` binary array denoting whether each question
was answered correctly (`True`|`1`) or incorrectly
(`False`/`0`).
Expand Down Expand Up @@ -963,3 +963,5 @@ def z2r(z):
Correlation value(s).
"""
return (np.exp(2 * z) - 1) / (np.exp(2 * z) + 1)


28 changes: 20 additions & 8 deletions code/khan_helpers/khan_helpers/participant.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,16 @@ def get_data(self, lecture=None, quiz=None):
def get_kmap(self, kmap_key):
"""
dict.get()-like access to self.knowledge_maps
:param trace_key: str
The key for the trace to be returned
:return: trace: np.ndarray
The trace stored under the given `trace_key`

Parameters
----------
kmap_key : str
The key for the knowledge map to be returned

Returns
-------
kmap : numpy.ndarray
The knowledge map stored under the given `kmap_key`
"""
try:
return self.knowledge_maps[kmap_key]
Expand All @@ -154,10 +160,16 @@ def get_kmap(self, kmap_key):
def get_trace(self, trace_key):
"""
dict.get()-like access to self.traces
:param trace_key: str
The key for the trace to be returned
:return: trace: np.ndarray
The trace stored under the given `trace_key`

Parameters
----------
trace_key : str
The key for the trace to be returned

Returns
-------
trace : numpy.ndarray
The trace stored under the given `trace_key`
"""
try:
return self.traces[trace_key]
Expand Down
19 changes: 11 additions & 8 deletions code/notebooks/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
This folder contains notebooks to replicate analyses and figures from the
[paper](../../per/main.pdf). Notebooks are generally ordered according to when
[paper](../../paper/main.pdf). Notebooks are generally ordered according to when
analyses are described or figures appear in the paper.

### `main/`
**code to reproduce analyses and figures from the main text**
- `1_model-course-content.ipynb` – code to fit the topic model, transform lectures & quizzes, and generate Figure 2C
- `1_model-course-content.ipynb` – code to fit the topic model, transform lectures & quiz questions, and generate Figure 2C
- `2_topic-variability-fig.ipynb` – code to generate Figure 3 and compute related stats
- `3_lecture-question-timeseries-fig.ipynb` – code to generate Figure 4
- `4_reconstructing-knowledge.ipynb` – code to estimate dynamic knowledge traces, generate Figure 5, and compute related stats
- `5_predictive-analyses.ipynb` – code to generate Figure 6
- `6_knowledge-maps.ipynb` – code to construct knowledge maps and generate Figure 7
- `7_parse_demographics.ipynb` – code to compile demographic data described in _Methods_
- `8_get-transcripts.ipynb` – code to fetch automated transcripts from the YouTube API as described in _Methods_
- `6_knowledge-smoothness.ipynb` – code to generate Figure 7
- `7_knowledge-maps.ipynb` – code to construct knowledge maps and generate Figure 8
- `8_parse_demographics.ipynb` – code to compile demographic data described in _Methods_
- `9_get-transcripts.ipynb` – code to fetch automated transcripts from the YouTube API as described in _Methods_

### `supp/`
**code to reproduce tables and figures from the Supplementary Materials document**
- `1_tables.ipynb` – code to generate Supplementary Tables 1 & 2
- `1_tables.ipynb` – code to generate Supplementary Tables 1, 2, and 3, and compute the correlation timeseries peaks shown in Supplementary Figures 3 & 4
- `2_topic-word-distributions-fig.ipynb` – code to generate Supplementary Figure 1
- `2_topic-weight-fig.ipynb` – code to generate Supplementary Figure 2 and compute related stats
- `3_individual-maps.ipynb` – code to generate Supplementary Figures 2–6
- `3_topic-weight-fig.ipynb` – code to generate Supplementary Figure 2 and compute related stats
- `4_lecture-question-correlation-peaks.ipynb` – code to generate Supplementary Figures 3 & 4
- `5_model-comparison-BERT.ipynb` – code to generate Supplementary Figure 5
- `6_individual-maps.ipynb` – code to generate Supplementary Figures 2–6
518 changes: 416 additions & 102 deletions code/notebooks/main/5_predictive-analyses.ipynb

Large diffs are not rendered by default.

Loading