Repository navigation
feat: Add ability to generate more realistic learner journey data #276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
26b3bc6
feat: Add ability to generate more realistic learner journey data
2fd41bc
fix: tidy learner journeys for review
f5554be
refactor: clearer names in learner journeys
c02d496
fix: don't leave a stale manifest or a most active learner with no pa…
d9a438f
fix: check journeys config values before writing any output
a057328
feat: load a journeys dataset into Aspects with load-journeys
506ab80
feat: add the most views of any second to the expected video results
8601fd1
fix: let load-journeys data sit next to load-db data
54bee70
feat: name the events that never arrived when load-journeys times out
4ec2d77
fix: pace load-journeys output for Vector
c888221
test: cover the rest of the learner journeys code
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| xapi\_db\_load.journeys package | ||
| =============================== | ||
|
|
||
| Submodules | ||
| ---------- | ||
|
|
||
| xapi\_db\_load.journeys.generate module | ||
| --------------------------------------- | ||
|
|
||
| .. automodule:: xapi_db_load.journeys.generate | ||
| :members: | ||
| :show-inheritance: | ||
| :undoc-members: | ||
|
|
||
| xapi\_db\_load.journeys.oracle module | ||
| ------------------------------------- | ||
|
|
||
| .. automodule:: xapi_db_load.journeys.oracle | ||
| :members: | ||
| :show-inheritance: | ||
| :undoc-members: | ||
|
|
||
| xapi\_db\_load.journeys.simulate module | ||
| --------------------------------------- | ||
|
|
||
| .. automodule:: xapi_db_load.journeys.simulate | ||
| :members: | ||
| :show-inheritance: | ||
| :undoc-members: | ||
|
|
||
| xapi\_db\_load.journeys.statements module | ||
| ----------------------------------------- | ||
|
|
||
| .. automodule:: xapi_db_load.journeys.statements | ||
| :members: | ||
| :show-inheritance: | ||
| :undoc-members: | ||
|
|
||
| xapi\_db\_load.journeys.structure module | ||
| ---------------------------------------- | ||
|
|
||
| .. automodule:: xapi_db_load.journeys.structure | ||
| :members: | ||
| :show-inheritance: | ||
| :undoc-members: | ||
|
|
||
| Module contents | ||
| --------------- | ||
|
|
||
| .. automodule:: xapi_db_load.journeys | ||
| :members: | ||
| :show-inheritance: | ||
| :undoc-members: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # Large learner-journey dataset (~75M xAPI events, 100k learners) for benchmarks. | ||
| # Generate: xapi-db-load journeys --config_file example_configs/journeys_l.yaml | ||
| lms_url: http://localhost:18000 | ||
|
|
||
| journeys: | ||
| seed: 2027 | ||
| output_dir: logs/journeys_l | ||
| now: null | ||
| window_days: 330 | ||
| running_course_fraction: 0.4 | ||
| course_length_days: 120 | ||
| num_organizations: 5 | ||
| num_actors: 100000 | ||
| mbox_actor_fraction: 0.05 | ||
| num_actor_profile_changes: 2 | ||
| course_publishes: 5 | ||
| deleted_unit_course_fraction: 0.1 | ||
| sort_events: false | ||
| courses: | ||
| - {template: small, count: 300, runs: [1, 3], learners: [50, 300]} | ||
| - {template: medium, count: 200, runs: [1, 3], learners: [200, 800]} | ||
| - {template: large, count: 75, runs: [1, 2], learners: [300, 1100]} | ||
| course_templates: | ||
| small: | ||
| chapters: [3, 5] | ||
| sequentials_per_chapter: [2, 4] | ||
| verticals_per_sequential: [2, 5] | ||
| problems_per_vertical_weights: [0.5, 0.3, 0.2] | ||
| videos_per_vertical_weights: [0.5, 0.45, 0.05] | ||
| graded_sequential_fraction: 0.3 | ||
| video_length: [60, 600] | ||
| medium: | ||
| chapters: [5, 8] | ||
| sequentials_per_chapter: [3, 5] | ||
| verticals_per_sequential: [3, 6] | ||
| problems_per_vertical_weights: [0.4, 0.35, 0.2, 0.05] | ||
| videos_per_vertical_weights: [0.45, 0.5, 0.05] | ||
| graded_sequential_fraction: 0.3 | ||
| video_length: [60, 900] | ||
| large: | ||
| chapters: [8, 14] | ||
| sequentials_per_chapter: [3, 6] | ||
| verticals_per_sequential: [3, 8] | ||
| problems_per_vertical_weights: [0.35, 0.35, 0.2, 0.1] | ||
| videos_per_vertical_weights: [0.4, 0.55, 0.05] | ||
| graded_sequential_fraction: 0.3 | ||
| video_length: [60, 1200] | ||
| behavior: | ||
| completer_fraction: 0.1 | ||
| continue_prob: 0.9 | ||
| duplicate_event_prob: 0.001 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # Medium learner-journey dataset (~15M xAPI events, 25k learners) for benchmarks. | ||
| # Generate: xapi-db-load journeys --config_file example_configs/journeys_m.yaml | ||
| lms_url: http://localhost:18000 | ||
|
|
||
| journeys: | ||
| seed: 2026 | ||
| output_dir: logs/journeys_m | ||
| now: null | ||
| window_days: 330 | ||
| running_course_fraction: 0.4 | ||
| course_length_days: 120 | ||
| num_organizations: 5 | ||
| num_actors: 25000 | ||
| mbox_actor_fraction: 0.05 | ||
| num_actor_profile_changes: 2 | ||
| course_publishes: 5 | ||
| deleted_unit_course_fraction: 0.1 | ||
| sort_events: false | ||
| courses: | ||
| - {template: small, count: 60, runs: [1, 3], learners: [50, 300]} | ||
| - {template: medium, count: 40, runs: [1, 3], learners: [200, 800]} | ||
| - {template: large, count: 15, runs: [1, 2], learners: [300, 1100]} | ||
| course_templates: | ||
| small: | ||
| chapters: [3, 5] | ||
| sequentials_per_chapter: [2, 4] | ||
| verticals_per_sequential: [2, 5] | ||
| problems_per_vertical_weights: [0.5, 0.3, 0.2] | ||
| videos_per_vertical_weights: [0.5, 0.45, 0.05] | ||
| graded_sequential_fraction: 0.3 | ||
| video_length: [60, 600] | ||
| medium: | ||
| chapters: [5, 8] | ||
| sequentials_per_chapter: [3, 5] | ||
| verticals_per_sequential: [3, 6] | ||
| problems_per_vertical_weights: [0.4, 0.35, 0.2, 0.05] | ||
| videos_per_vertical_weights: [0.45, 0.5, 0.05] | ||
| graded_sequential_fraction: 0.3 | ||
| video_length: [60, 900] | ||
| large: | ||
| chapters: [8, 14] | ||
| sequentials_per_chapter: [3, 6] | ||
| verticals_per_sequential: [3, 8] | ||
| problems_per_vertical_weights: [0.35, 0.35, 0.2, 0.1] | ||
| videos_per_vertical_weights: [0.4, 0.55, 0.05] | ||
| graded_sequential_fraction: 0.3 | ||
| video_length: [60, 1200] | ||
| behavior: | ||
| completer_fraction: 0.1 | ||
| continue_prob: 0.9 | ||
| duplicate_event_prob: 0.001 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # Small, deterministic learner-journey dataset with every edge case turned on. | ||
| # Generate: xapi-db-load journeys --config_file example_configs/journeys_oracle.yaml | ||
| # The expected_*.csv.gz files hold the known-correct engagement results. | ||
| lms_url: http://localhost:18000 | ||
|
|
||
| journeys: | ||
| seed: 1335 | ||
| output_dir: logs/journeys_oracle | ||
| # Pin "now" so the dataset is identical on every run. Keep it within a day of the time the data | ||
| # is loaded if you want some events inside refreshable-view lookback windows. | ||
| now: null | ||
| window_days: 200 | ||
| running_course_fraction: 0.6 | ||
| course_length_days: 90 | ||
| num_organizations: 2 | ||
| num_actors: 60 | ||
| mbox_actor_fraction: 0.15 | ||
| num_actor_profile_changes: 3 | ||
| course_publishes: 3 | ||
| deleted_unit_course_fraction: 0.5 | ||
| # Order xapi.csv by time across all learners, as live traffic arrives, so watch sessions get | ||
| # split across insert batches when loaded in small blocks. | ||
| sort_events: true | ||
| courses: | ||
| - {template: small, count: 2, runs: [1, 2], learners: [15, 30]} | ||
| - {template: medium, count: 2, runs: [1, 1], learners: [20, 40]} | ||
| course_templates: | ||
| small: | ||
| chapters: [2, 3] | ||
| sequentials_per_chapter: [1, 3] | ||
| verticals_per_sequential: [1, 4] | ||
| problems_per_vertical_weights: [0.5, 0.3, 0.2] | ||
| videos_per_vertical_weights: [0.5, 0.4, 0.1] | ||
| graded_sequential_fraction: 0.3 | ||
| video_length: [30, 240] | ||
| medium: | ||
| chapters: [3, 5] | ||
| sequentials_per_chapter: [2, 4] | ||
| verticals_per_sequential: [2, 5] | ||
| problems_per_vertical_weights: [0.4, 0.4, 0.2] | ||
| videos_per_vertical_weights: [0.5, 0.4, 0.1] | ||
| graded_sequential_fraction: 0.3 | ||
| video_length: [30, 300] | ||
| behavior: | ||
| completer_fraction: 0.25 | ||
| continue_prob: 0.85 | ||
| same_time_resume_prob: 0.2 | ||
| duplicate_event_prob: 0.02 | ||
| recent_activity_fraction: 0.15 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| """ | ||
| Learner-journey data generation. | ||
|
|
||
| Unlike the random event mode, which picks every event independently, this mode simulates each | ||
| enrolled learner moving through a properly nested course: navigating units in order, attempting | ||
| the problems and watching the videos in them, in time-ordered sessions. Because the generator knows | ||
| exactly what each learner did, it also writes the expected engagement results, so reports can be | ||
| checked against a known answer. | ||
| """ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[NIT]: the surface splits one person into two words — config says
learners, data saysactor_id: either rename the schema-level keys toward one term or add one README sentence declaring the split deliberate (keepactor_id; renaming it breaks the aspects-dbt consumers).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving as is. The config already uses
num_actorsfor people, andlearnersin a course entry is the number of enrollments, so the two words name different things.actor_idmatches Aspects, as you say.