make-mp-data 1.5.54 → 1.5.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,314 +0,0 @@
1
-
2
- const SEED = "my-seed";
3
- const dayjs = require("dayjs");
4
- const utc = require("dayjs/plugin/utc");
5
- dayjs.extend(utc);
6
- require("dotenv").config();
7
- const u = require("../components/utils.js");
8
- const v = require("ak-tools");
9
- const chance = u.initChance(SEED);
10
- const num_users = 25_000;
11
- const days = 180;
12
-
13
- /** @typedef {import("../types.js").Dungeon} Config */
14
-
15
- /** @type {Config} */
16
- const config = {
17
- token: "17f327eeb2217278f5b2c42a54aafe96",
18
- seed: "sdgsdfgdfgkfj dfgkjh",
19
- numDays: days,
20
- numEvents: num_users * 90,
21
- numUsers: num_users,
22
- hasAnonIds: false,
23
- hasSessionIds: false,
24
- format: "json",
25
- alsoInferFunnels: true,
26
- hasLocation: true,
27
- hasAndroidDevices: true,
28
- hasIOSDevices: true,
29
- hasDesktopDevices: true,
30
- hasBrowser: false,
31
- hasCampaigns: true,
32
- isAnonymous: false,
33
- hasAdSpend: false,
34
- percentUsersBornInDataset: 35,
35
-
36
- hasAvatar: true,
37
- makeChart: false,
38
-
39
- batchSize: 1_500_000,
40
- concurrency: 1,
41
- writeToDisk: false,
42
- funnels: [
43
- {
44
- "sequence": ["app install", "character creation", "join party"],
45
- "isFirstFunnel": true,
46
- "conversionRate": 0.8,
47
- "timeToConvert": .25,
48
- },
49
- {
50
- "sequence": ["start quest", "gameplay summary", "complete quest"],
51
- conversionRate: 0.99,
52
- timeToConvert: 1,
53
- props: {
54
- "quest type": u.pickAWinner([
55
- "Rescue",
56
- "Retrieve",
57
- "Explore",
58
- "Destroy",
59
- "Investigate",
60
- ]),
61
- "quest difficulty": u.pickAWinner([
62
- "Easy",
63
- "Medium",
64
- "Hard",
65
- "Legendary",
66
- ]),
67
- "quest location": u.pickAWinner([
68
- "Forest",
69
- "Dungeon",
70
- "Mountain",
71
- "City",
72
- "Desert",
73
- ])
74
- }
75
- },
76
- ],
77
- events: [
78
- { event: "app install", weight: 10, isFirstEvent: true },
79
- {
80
- event: "character creation",
81
- weight: 2,
82
- properties: {
83
- mode: u.pickAWinner(["fast", "slow", "template"]),
84
- },
85
- },
86
- {
87
- event: "join party",
88
- weight: 8,
89
- properties: {
90
- "party size": u.weighNumRange(1, 6),
91
- "party leader": u.pickAWinner([
92
- "Bard",
93
- "Cleric",
94
- "Fighter",
95
- "Rogue",
96
- "Wizard",
97
- "Paladin",
98
- "Ranger",
99
- "Sorcerer",
100
- "Warlock",
101
- ]),
102
- },
103
- },
104
- {
105
- event: "start quest",
106
- weight: 12,
107
- properties: {},
108
- },
109
- {
110
- event: "complete quest",
111
- weight: 12,
112
- properties: {},
113
- },
114
- {
115
- "event": "gameplay summary",
116
- "weight": 14,
117
- "properties": {
118
- "# enemies defeated": u.weighNumRange(0, 100),
119
- "# respawns": u.weighNumRange(0, 10, 5),
120
- "# attacks": u.weighNumRange(0, 100, 6, 12),
121
- "# gold found": u.weighNumRange(0, 1000),
122
- }
123
- },
124
- {
125
- "event": "in-game purchase",
126
- "weight": 2,
127
- "properties": {
128
- "purchase type": u.pickAWinner([
129
- "Gold",
130
- "Gems",
131
- "Items: Weapons",
132
- "Items: Armor",
133
- "Items: Potions",
134
- "Items: Scrolls",
135
- "Boosts",
136
- "Currency",
137
- ]),
138
- "purchase amount": u.weighNumRange(1, 50, 1, 20),
139
- }
140
- },
141
- {
142
- event: "fight boss",
143
- weight: 3,
144
- properties: {
145
- "boss type": u.pickAWinner([
146
- "Dragon",
147
- "Demon",
148
- "Lich",
149
- "Vampire",
150
- "Beholder",
151
- ]),
152
- "boss level": u.weighNumRange(10, 20),
153
- "boss difficulty": u.pickAWinner([
154
- "Hard",
155
- "Legendary",
156
- "Impossible",
157
- ]),
158
- "fight duration (mins)": u.weighNumRange(1, 60),
159
-
160
- },
161
- },
162
- {
163
- event: "level up",
164
- weight: 1,
165
- properties: {
166
- "new abilities": u.pickAWinner([
167
- "Attack",
168
- "Spell",
169
- "Feat",
170
- "Skill",
171
- ]),
172
- },
173
- },
174
- {
175
- event: "generic event (common)",
176
- weight: 5,
177
- properties: {
178
- generic_prop: u.pickAWinner(["foo", "bar", "baz", "qux"]),
179
- }
180
- },
181
- {
182
- event: "generic event (uncommon)",
183
- weight: 3,
184
- properties: {
185
- generic_prop: u.pickAWinner(["foo", "bar", "baz", "qux"]),
186
- }
187
- },
188
- ],
189
- superProps: {
190
- platform: u.pickAWinner([
191
- "Mobile",
192
- "Xbox",
193
- "Playstation",
194
- "Switch",
195
- "Web"
196
- ]),
197
- "game mode": u.pickAWinner([
198
- "Single Player",
199
- "Multiplayer",
200
- ], 1),
201
- language: u.pickAWinner([
202
- "English",
203
- "Spanish",
204
- "French",
205
- "German",
206
- "Japanese",
207
- "Korean",
208
- "Chinese",
209
- ], 0),
210
-
211
- },
212
- scdProps: {
213
- // "subscription MRR" : {
214
- // "frequency": "week",
215
- // "type": "number",
216
- // values: u.weighNumRange(0, 250, 1, 200),
217
- // timing: "fixed",
218
- // max: 250,
219
- // }
220
- },
221
- userProps: {
222
- experiment: u.pickAWinner([
223
- "fast leveling",
224
- "tension economy",
225
- "free trial",
226
- ]),
227
- variant: ["A", "B", "C", "Control"],
228
-
229
- race: u.pickAWinner([
230
- "Human",
231
- "Elf",
232
- "Dwarf",
233
- "Halfling",
234
- "Dragonborn",
235
- "Gnome",
236
- "Half-Elf",
237
- "Half-Orc",
238
- "Tiefling",
239
- ]),
240
- class: u.pickAWinner([
241
- "Barbarian",
242
- "Bard",
243
- "Cleric",
244
- "Druid",
245
- "Fighter",
246
- "Monk",
247
- "Paladin",
248
- "Ranger",
249
- "Rogue",
250
- "Sorcerer",
251
- "Warlock",
252
- "Wizard",
253
- ]),
254
- alignment: u.pickAWinner([
255
- "Lawful Good",
256
- "Neutral Good",
257
- "Chaotic Good",
258
- "Lawful Neutral",
259
- "True Neutral",
260
- "Chaotic Neutral",
261
- "Lawful Evil",
262
- "Neutral Evil",
263
- "Chaotic Evil",
264
- ]),
265
- level: u.weighNumRange(1, 20),
266
- background: u.pickAWinner([
267
- "Acolyte",
268
- "Charlatan",
269
- "Criminal",
270
- "Entertainer",
271
- "Folk Hero",
272
- "Guild Artisan",
273
- "Hermit",
274
- "Noble",
275
- "Outlander",
276
- "Sage",
277
- "Sailor",
278
- "Soldier",
279
- "Urchin",
280
- ]),
281
- "subscription MRR": u.weighNumRange(0, 250, 1, 200)
282
- },
283
- hook: function (record, type, meta) {
284
- // const NOW = dayjs();
285
-
286
- if (type === "event") {
287
- // const EVENT_TIME = dayjs(record.time);
288
- }
289
-
290
- if (type === "user") {
291
-
292
- }
293
-
294
- if (type === "funnel-post") {
295
-
296
- }
297
-
298
- if (type === "funnel-pre") {
299
-
300
- }
301
-
302
- if (type === "scd") {
303
-
304
- }
305
-
306
- if (type === "everything") {
307
-
308
- }
309
-
310
- return record;
311
- }
312
- };
313
-
314
- module.exports = config;
@@ -1,288 +0,0 @@
1
- const run = require("../index.js");
2
- const SEED = "my-seed";
3
- const dayjs = require("dayjs");
4
- const utc = require("dayjs/plugin/utc");
5
- dayjs.extend(utc);
6
- require("dotenv").config();
7
- const u = require("../components/utils");
8
- const v = require("ak-tools");
9
- const { projectId, serviceAccount, serviceSecret } = require("./adspend");
10
- const chance = u.initChance(SEED);
11
- const num_users = 1_500;
12
- const days = 91;
13
-
14
- const GOVERNANCE_TOKEN = process.env.GOVERNANCE_TOKEN;
15
- const GOVERNANCE_ID = process.env.GOVERNANCE_ID;
16
- const GOVERNANCE_ACCT = process.env.GOVERNANCE_ACCT;
17
- const GOVERNANCE_SECRET = process.env.GOVERNANCE_SECRET;
18
-
19
- const URLS = [
20
- "/",
21
- "/refinance-student-loan/",
22
- "/private-student-loans/",
23
- "/personal-loans/",
24
- "/home-loans/",
25
- "/invest/",
26
- "/banking/",
27
- "/relay/",
28
- "/life-insurance/",
29
- "/learn/",
30
- "/faq/",
31
- "/career-advisory/",
32
- "/member-benefits/",
33
- "/experiences/",
34
- "/member-stories/",
35
- "/contact-us/",
36
- "/jobs/",
37
- "/on-the-money/",
38
- "/about-sofi/",
39
- "/management-team/",
40
- "/eligibility-criteria/",
41
- "/referral-program/",
42
- "/sofi-at-work/"
43
- ];
44
-
45
- /** @type {Config} */
46
- const commonOpts = {
47
- verbose: true,
48
- token: GOVERNANCE_TOKEN,
49
- projectId: GOVERNANCE_ID,
50
- serviceAccount: GOVERNANCE_ACCT,
51
- serviceSecret: GOVERNANCE_SECRET,
52
- numDays: days,
53
- numEvents: num_users * 100,
54
- numUsers: num_users,
55
- hasAnonIds: false,
56
- hasSessionIds: true,
57
- format: "json",
58
- alsoInferFunnels: true,
59
- hasLocation: true,
60
- hasAndroidDevices: false,
61
- hasIOSDevices: false,
62
- hasDesktopDevices: false,
63
- hasBrowser: true,
64
- hasCampaigns: false,
65
- isAnonymous: false,
66
- hasAdSpend: false,
67
-
68
- hasAvatar: true,
69
- makeChart: false,
70
-
71
- batchSize: 1_500_000,
72
- concurrency: 1,
73
- writeToDisk: false,
74
- percentUsersBornInDataset: 15
75
-
76
- };
77
-
78
- /** @typedef {import("../types").Dungeon} Config */
79
-
80
- /** @type {Config} */
81
- const diffNameSameMeaning = {
82
- ...commonOpts,
83
- name: "same-meaning",
84
- hasAdSpend: true,
85
- seed: "foo",
86
- description: "A dungeon with really unclear event names",
87
- funnels: [],
88
- events: [
89
- //@ts-ignore
90
- " login", "login ", " sign in", "login", "Log In", "Sign In", "sign in", "signin", "page view", "page viewed", "viewed page", "view page", "pageview", "page viewed", "page view", "pageviewed", "page viewed", "page view", "pageview", "page viewed", "page view", "pageviewed", "page viewed", "page view", "pageview", "page viewed", "page view", "pageviewed", "page viewed", "page view", "pageview", "page viewed", "page view", "pageviewed", "page viewed", "page view", "pageview", "page viewed", "page view", "pageviewed", "page viewed", "page view", "pageview", "page viewed", "page view", "pageviewed", "page viewed", "page view", "pageview", "page viewed", "page view", "pageviewed", "page viewed", "page view", "pageview", "page viewed", "page view", "pageviewed", "page viewed", "page view", "pageview", "page viewed", "page view", "pageviewed", "page viewed", "page view", "pageview", "page viewed", "page view", "pageviewed", "page viewed", "page view", "pageview", "page viewed", "page view", "pageviewed", "page viewed", "page view", "pageview", "page viewed", "page view", "pageviewed", "page viewed", "page view", "pageview", "page viewed", "page view", "pageviewed", "page viewed", "page view", "pageview", "page viewed", "page view", "page_viewed", "page"
91
- ],
92
- superProps: {
93
- "theme": "diff name; same meaning",
94
- "url": u.pickAWinner(URLS, 0)
95
- },
96
- userProps: {},
97
- hook: (a, type) => {
98
- if (type === "everything") {
99
- return a;
100
- }
101
-
102
- return a;
103
- }
104
- };
105
-
106
-
107
- /** @type {Config} */
108
- const sameNameDiffMeaning = {
109
- ...commonOpts,
110
- name: "diff-meanings",
111
- seed: "bar",
112
- description: "a dataset with a single event that means different things",
113
- funnels: [],
114
- events: [
115
- {
116
- event: "button click",
117
- properties: {
118
- "button name": ["start now", "register", "submit", "learn more", "try now", "free trial"],
119
- "form name": u.pickAWinner(["mortgage", "student loan", "personal loan ", "credit card ", "savings account", "subscribe form"]),
120
- "cta": ["free for 30d", "decision in 5min", "chat with a human", "try it in the app"],
121
- }
122
- }
123
- ],
124
- superProps: {
125
- "theme": "same name; diff meaning",
126
- "url": u.pickAWinner(URLS, 0)
127
- },
128
- userProps: {},
129
- scdProps: {},
130
- hook: (a, type) => {
131
- if (type === "everything") {
132
- return a;
133
- }
134
-
135
- return a;
136
- }
137
- };
138
-
139
- /** @type {Config} */
140
- const Borrowing = {
141
- ...commonOpts,
142
- percentUsersBornInDataset: 100,
143
- alsoInferFunnels: false,
144
- name: "borrowing",
145
- seed: "baz",
146
- description: "a dataset which requires borrowing",
147
- funnels: [
148
- {
149
- "sequence": ["page viewed", "click!", "sign up"],
150
- "isFirstFunnel": true,
151
- "order": "sequential"
152
- },
153
- {
154
- "sequence": ["start application", "submit application"],
155
- "props": {
156
- "product": u.pickAWinner(["mortgage", "student loan", "personal loan ", "credit card ", "savings account", "investing account"]),
157
- "application Id": () => { return v.uid(10); },
158
- }
159
- }
160
- ],
161
- events: [
162
- {
163
- event: "page viewed",
164
- properties: {
165
- "marketing channel": u.pickAWinner(["organic", "meta", "google", "x", "snapchat", "youtube", "instagram"], 0),
166
- }
167
- },
168
- {
169
- event: "click!",
170
- properties: {
171
- "CTA clicked": u.pickAWinner(["start now", "register", "submit", "learn more", "try now", "free trial"]),
172
- }
173
- },
174
- {
175
- event: "sign up",
176
- properties: {
177
- "A/B test": ["fast onboarding", "custom colors", "localization", "new design"],
178
- "Variant": ["A", "B", "C", "Control"]
179
- },
180
- isFirstEvent: true
181
- },
182
- {
183
- event: "start application",
184
-
185
- },
186
- {
187
- event: "submit application",
188
- },
189
- ],
190
- superProps: {
191
- "theme": "requires borrows",
192
- "url": u.pickAWinner(URLS, 0)
193
- },
194
- userProps: {},
195
- scdProps: {},
196
- hook: (a, type) => {
197
- if (type === "everything") {
198
- return a;
199
- }
200
-
201
- return a;
202
- }
203
- };
204
-
205
-
206
- /** @type {Config} */
207
- const Modeling = {
208
- ...commonOpts,
209
- percentUsersBornInDataset: 100,
210
- alsoInferFunnels: false,
211
- name: "bad shapes",
212
- seed: "qux",
213
- description: "a data set with bad modeling",
214
- funnels: [
215
-
216
- ],
217
- events: [
218
- {
219
- event: "nested nightmare",
220
- properties: {
221
- data: buildAStupidNestedObject
222
- }
223
- },
224
- ],
225
- superProps: {
226
- "theme": "deeply nested",
227
- "url": u.pickAWinner(URLS, 0)
228
- },
229
- userProps: {},
230
- scdProps: {},
231
- hook: (a, type) => {
232
- if (type === "everything") {
233
- return a;
234
- }
235
-
236
- return a;
237
- }
238
- };
239
-
240
- const metaValues = u.pickAWinner(["foo", "bar", "baz", "qux", "quux", "corge", "grault", "garply", "waldo", "fred", "plugh", "xyzzy", "thud"]);
241
- function buildAStupidNestedObject(depth = 0) {
242
- let obj = {};
243
- const keyPrefix = ["A", "B", "C", "D", "E", "F", "G", "H", "I"];
244
- const keySuffix = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
245
-
246
- let numKeys = chance.integer({ min: 1, max: 5 });
247
- for (let i = 0; i < numKeys; i++) {
248
- if (depth <= 3 && chance.bool({ likelihood: 10 })) {
249
- let key = chance.pickone(keyPrefix) + ">" + chance.pickone(keySuffix);
250
- obj[key] = buildAStupidNestedObject();
251
- }
252
- else {
253
- let key = chance.pickone(keyPrefix) + "|" + chance.pickone(keySuffix);
254
- let value = u.choose(metaValues);
255
- obj[key] = value;
256
- }
257
- }
258
- return obj;
259
- }
260
-
261
-
262
- const dungeons = [
263
- diffNameSameMeaning,
264
- sameNameDiffMeaning,
265
- Borrowing,
266
- Modeling
267
- ];
268
-
269
- async function runDungeons() {
270
- const results = [];
271
- for (let dungeon of dungeons) {
272
- const job = await run(dungeon);
273
- results.push(job);
274
- }
275
- return results;
276
- }
277
-
278
- runDungeons()
279
- .then(results => {
280
- debugger;
281
- })
282
- .catch(e => {
283
- console.error(e);
284
- debugger;
285
-
286
- });
287
-
288
- module.exports = {};