JarrettYe commited on
Commit
6d50123
β€’
1 Parent(s): b430afc

update to 3.13.3

Browse files
Files changed (4) hide show
  1. .gitignore +3 -1
  2. app.py +1 -1
  3. fsrs4anki_optimizer.ipynb +15 -15
  4. utilities.py +2 -2
.gitignore CHANGED
@@ -1,2 +1,4 @@
1
  .idea/
2
- projects
 
 
 
1
  .idea/
2
+ __pycache__
3
+ projects
4
+ .DS_Store
app.py CHANGED
@@ -58,7 +58,7 @@ def anki_optimizer(file, timezone, next_day_starts_at, revlog_start_date, reques
58
 
59
 
60
  description = """
61
- # FSRS4Anki Optimizer App - v3.13.0
62
  Based on the [tutorial](https://medium.com/@JarrettYe/how-to-use-the-next-generation-spaced-repetition-algorithm-fsrs-on-anki-5a591ca562e2)
63
  of [Jarrett Ye](https://github.com/L-M-Sherlock). This application can give you personalized anki parameters without having to code.
64
 
 
58
 
59
 
60
  description = """
61
+ # FSRS4Anki Optimizer App - v3.13.3
62
  Based on the [tutorial](https://medium.com/@JarrettYe/how-to-use-the-next-generation-spaced-repetition-algorithm-fsrs-on-anki-5a591ca562e2)
63
  of [Jarrett Ye](https://github.com/L-M-Sherlock). This application can give you personalized anki parameters without having to code.
64
 
fsrs4anki_optimizer.ipynb CHANGED
@@ -5,7 +5,7 @@
5
  "cell_type": "markdown",
6
  "metadata": {},
7
  "source": [
8
- "# FSRS4Anki v3.13.0 Optimizer"
9
  ]
10
  },
11
  {
@@ -15,7 +15,7 @@
15
  "id": "lurCmW0Jqz3s"
16
  },
17
  "source": [
18
- "[![open in colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-spaced-repetition/fsrs4anki/blob/v3.13.0/fsrs4anki_optimizer.ipynb)\n",
19
  "\n",
20
  "↑ Click the above button to open the optimizer on Google Colab.\n",
21
  "\n",
@@ -172,7 +172,7 @@
172
  {
173
  "data": {
174
  "application/vnd.jupyter.widget-view+json": {
175
- "model_id": "191e41fc14f34c1789b34cf09aaf92cb",
176
  "version_major": 2,
177
  "version_minor": 0
178
  },
@@ -193,7 +193,7 @@
193
  {
194
  "data": {
195
  "application/vnd.jupyter.widget-view+json": {
196
- "model_id": "102e8887ab69420b98d1a45ae1488714",
197
  "version_major": 2,
198
  "version_minor": 0
199
  },
@@ -214,7 +214,7 @@
214
  {
215
  "data": {
216
  "application/vnd.jupyter.widget-view+json": {
217
- "model_id": "122b8eeefd6b4411bb046c363d1d0b03",
218
  "version_major": 2,
219
  "version_minor": 0
220
  },
@@ -235,7 +235,7 @@
235
  {
236
  "data": {
237
  "application/vnd.jupyter.widget-view+json": {
238
- "model_id": "57d8bf7a22f743e4abbe5d59f6c642cc",
239
  "version_major": 2,
240
  "version_minor": 0
241
  },
@@ -296,8 +296,7 @@
296
  " 'last_lvl', 'factor', 'time', 'type']\n",
297
  "df = df[(df['cid'] <= time.time() * 1000) &\n",
298
  " (df['id'] <= time.time() * 1000) &\n",
299
- " (df['r'] > 0) &\n",
300
- " (df['id'] >= time.mktime(datetime.strptime(revlog_start_date, \"%Y-%m-%d\").timetuple()) * 1000)].copy()\n",
301
  "df['create_date'] = pd.to_datetime(df['cid'] // 1000, unit='s')\n",
302
  "df['create_date'] = df['create_date'].dt.tz_localize(\n",
303
  " 'UTC').dt.tz_convert(timezone)\n",
@@ -337,6 +336,7 @@
337
  "\n",
338
  "tqdm.notebook.tqdm.pandas()\n",
339
  "df = df.groupby('cid', as_index=False).progress_apply(get_feature)\n",
 
340
  "df[\"t_history\"] = df[\"t_history\"].map(lambda x: x[1:] if len(x) > 1 else x)\n",
341
  "df[\"r_history\"] = df[\"r_history\"].map(lambda x: x[1:] if len(x) > 1 else x)\n",
342
  "df.to_csv('revlog_history.tsv', sep=\"\\t\", index=False)\n",
@@ -536,7 +536,7 @@
536
  {
537
  "data": {
538
  "application/vnd.jupyter.widget-view+json": {
539
- "model_id": "f875359e6b654aeb81d71ba1d3aa10f7",
540
  "version_major": 2,
541
  "version_minor": 0
542
  },
@@ -557,7 +557,7 @@
557
  {
558
  "data": {
559
  "application/vnd.jupyter.widget-view+json": {
560
- "model_id": "fa5c00f549ec4f9884381ca7a2c7d359",
561
  "version_major": 2,
562
  "version_minor": 0
563
  },
@@ -578,7 +578,7 @@
578
  {
579
  "data": {
580
  "application/vnd.jupyter.widget-view+json": {
581
- "model_id": "be0c599e33f841a1ad07fa3ca8b2d22b",
582
  "version_major": 2,
583
  "version_minor": 0
584
  },
@@ -905,7 +905,7 @@
905
  {
906
  "data": {
907
  "application/vnd.jupyter.widget-view+json": {
908
- "model_id": "f99be96c169b45f8a03d1355e71b679a",
909
  "version_major": 2,
910
  "version_minor": 0
911
  },
@@ -993,7 +993,7 @@
993
  {
994
  "data": {
995
  "application/vnd.jupyter.widget-view+json": {
996
- "model_id": "da652ded0f0241058f8f29e67410ef26",
997
  "version_major": 2,
998
  "version_minor": 0
999
  },
@@ -1137,7 +1137,7 @@
1137
  {
1138
  "data": {
1139
  "application/vnd.jupyter.widget-view+json": {
1140
- "model_id": "ca34a71cc6314383b98b249b4754f2a7",
1141
  "version_major": 2,
1142
  "version_minor": 0
1143
  },
@@ -1158,7 +1158,7 @@
1158
  {
1159
  "data": {
1160
  "application/vnd.jupyter.widget-view+json": {
1161
- "model_id": "8e836e6a67dd49db96d983e71c48f985",
1162
  "version_major": 2,
1163
  "version_minor": 0
1164
  },
 
5
  "cell_type": "markdown",
6
  "metadata": {},
7
  "source": [
8
+ "# FSRS4Anki v3.13.3 Optimizer"
9
  ]
10
  },
11
  {
 
15
  "id": "lurCmW0Jqz3s"
16
  },
17
  "source": [
18
+ "[![open in colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-spaced-repetition/fsrs4anki/blob/v3.13.3/fsrs4anki_optimizer.ipynb)\n",
19
  "\n",
20
  "↑ Click the above button to open the optimizer on Google Colab.\n",
21
  "\n",
 
172
  {
173
  "data": {
174
  "application/vnd.jupyter.widget-view+json": {
175
+ "model_id": "c9bb754c7ac441068199f88788b35a74",
176
  "version_major": 2,
177
  "version_minor": 0
178
  },
 
193
  {
194
  "data": {
195
  "application/vnd.jupyter.widget-view+json": {
196
+ "model_id": "ec878c2155d74cf1adefa0c7a0c8052a",
197
  "version_major": 2,
198
  "version_minor": 0
199
  },
 
214
  {
215
  "data": {
216
  "application/vnd.jupyter.widget-view+json": {
217
+ "model_id": "38f567392f7b4c73b92b3b336b04df4b",
218
  "version_major": 2,
219
  "version_minor": 0
220
  },
 
235
  {
236
  "data": {
237
  "application/vnd.jupyter.widget-view+json": {
238
+ "model_id": "6966fe105e3d4c398100ae20c5fb57fb",
239
  "version_major": 2,
240
  "version_minor": 0
241
  },
 
296
  " 'last_lvl', 'factor', 'time', 'type']\n",
297
  "df = df[(df['cid'] <= time.time() * 1000) &\n",
298
  " (df['id'] <= time.time() * 1000) &\n",
299
+ " (df['r'] > 0)].copy()\n",
 
300
  "df['create_date'] = pd.to_datetime(df['cid'] // 1000, unit='s')\n",
301
  "df['create_date'] = df['create_date'].dt.tz_localize(\n",
302
  " 'UTC').dt.tz_convert(timezone)\n",
 
336
  "\n",
337
  "tqdm.notebook.tqdm.pandas()\n",
338
  "df = df.groupby('cid', as_index=False).progress_apply(get_feature)\n",
339
+ "df = df[df['id'] >= time.mktime(datetime.strptime(revlog_start_date, \"%Y-%m-%d\").timetuple()) * 1000]\n",
340
  "df[\"t_history\"] = df[\"t_history\"].map(lambda x: x[1:] if len(x) > 1 else x)\n",
341
  "df[\"r_history\"] = df[\"r_history\"].map(lambda x: x[1:] if len(x) > 1 else x)\n",
342
  "df.to_csv('revlog_history.tsv', sep=\"\\t\", index=False)\n",
 
536
  {
537
  "data": {
538
  "application/vnd.jupyter.widget-view+json": {
539
+ "model_id": "749aeda9cb624986ae2872489bcc6762",
540
  "version_major": 2,
541
  "version_minor": 0
542
  },
 
557
  {
558
  "data": {
559
  "application/vnd.jupyter.widget-view+json": {
560
+ "model_id": "9ca6df8fb70247afaa07389ebf5bb791",
561
  "version_major": 2,
562
  "version_minor": 0
563
  },
 
578
  {
579
  "data": {
580
  "application/vnd.jupyter.widget-view+json": {
581
+ "model_id": "278f800ad8a344098c6b4a5de627fec8",
582
  "version_major": 2,
583
  "version_minor": 0
584
  },
 
905
  {
906
  "data": {
907
  "application/vnd.jupyter.widget-view+json": {
908
+ "model_id": "7712ed30c62643f4aa834c840458158c",
909
  "version_major": 2,
910
  "version_minor": 0
911
  },
 
993
  {
994
  "data": {
995
  "application/vnd.jupyter.widget-view+json": {
996
+ "model_id": "21d643c71d0540949822c71866f7e2b4",
997
  "version_major": 2,
998
  "version_minor": 0
999
  },
 
1137
  {
1138
  "data": {
1139
  "application/vnd.jupyter.widget-view+json": {
1140
+ "model_id": "63e8453d80124699b1f40395051577d7",
1141
  "version_major": 2,
1142
  "version_minor": 0
1143
  },
 
1158
  {
1159
  "data": {
1160
  "application/vnd.jupyter.widget-view+json": {
1161
+ "model_id": "e94ce239601948379611720ca3c73228",
1162
  "version_major": 2,
1163
  "version_minor": 0
1164
  },
utilities.py CHANGED
@@ -51,8 +51,7 @@ def create_time_series_features(revlog_start_date, timezone, next_day_starts_at,
51
  'last_lvl', 'factor', 'time', 'type']
52
  df = df[(df['cid'] <= time.time() * 1000) &
53
  (df['id'] <= time.time() * 1000) &
54
- (df['r'] > 0) &
55
- (df['id'] >= time.mktime(datetime.strptime(revlog_start_date, "%Y-%m-%d").timetuple()) * 1000)].copy()
56
  df['create_date'] = pd.to_datetime(df['cid'] // 1000, unit='s')
57
  df['create_date'] = df['create_date'].dt.tz_localize(
58
  'UTC').dt.tz_convert(timezone)
@@ -92,6 +91,7 @@ def create_time_series_features(revlog_start_date, timezone, next_day_starts_at,
92
 
93
  tqdm.pandas(desc='Saving Trainset')
94
  df = df.groupby('cid', as_index=False).progress_apply(get_feature)
 
95
  df["t_history"] = df["t_history"].map(lambda x: x[1:] if len(x) > 1 else x)
96
  df["r_history"] = df["r_history"].map(lambda x: x[1:] if len(x) > 1 else x)
97
  df.to_csv(proj_dir / 'revlog_history.tsv', sep="\t", index=False)
 
51
  'last_lvl', 'factor', 'time', 'type']
52
  df = df[(df['cid'] <= time.time() * 1000) &
53
  (df['id'] <= time.time() * 1000) &
54
+ (df['r'] > 0)].copy()
 
55
  df['create_date'] = pd.to_datetime(df['cid'] // 1000, unit='s')
56
  df['create_date'] = df['create_date'].dt.tz_localize(
57
  'UTC').dt.tz_convert(timezone)
 
91
 
92
  tqdm.pandas(desc='Saving Trainset')
93
  df = df.groupby('cid', as_index=False).progress_apply(get_feature)
94
+ df = df[df['id'] >= time.mktime(datetime.strptime(revlog_start_date, "%Y-%m-%d").timetuple()) * 1000]
95
  df["t_history"] = df["t_history"].map(lambda x: x[1:] if len(x) > 1 else x)
96
  df["r_history"] = df["r_history"].map(lambda x: x[1:] if len(x) > 1 else x)
97
  df.to_csv(proj_dir / 'revlog_history.tsv', sep="\t", index=False)