Skip to content

Commit a751c77

Browse files
authored
upload chapter 21 new file
try to fix the issue github can't recognize the json format from nb format
1 parent 8e6a354 commit a751c77

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

chapters/21 第二十一章 元学习器.ipynb

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -337,21 +337,8 @@
337337
"m0 = LGBMRegressor(max_depth=2, min_child_samples=60)\n",
338338
"m1 = LGBMRegressor(max_depth=2, min_child_samples=60)\n",
339339
"\n",
340-
<<<<<<< e022085c519423acf68e0d4c26b60d477788305d
341-
"# fit the propensity score model\n",
342-
"ps_m = LogisticRegression(solver=\"lbfgs\", penalty='none')\n",
343-
"ps_m.fit(train[X], train[T])\n",
344-
"ps_score = ps_m.predict_proba(train[X])\n",
345-
"\n",
346-
"m0.fit(train.query(f\"{T}==0\")[X], train.query(f\"{T}==0\")[y],\n",
347-
" sample_weight=1/ps_m.predict_proba(train.query(f\"{T}==0\")[X])[:, 0])\n",
348-
"\n",
349-
"m1.fit(train.query(f\"{T}==1\")[X], train.query(f\"{T}==1\")[y],\n",
350-
" sample_weight=1/ps_m.predict_proba(train.query(f\"{T}==1\")[X])[:, 1])\n",
351-
=======
352340
"m0.fit(train.query(f\"{T}==0\")[X], train.query(f\"{T}==0\")[y])\n",
353341
"m1.fit(train.query(f\"{T}==1\")[X], train.query(f\"{T}==1\")[y])\n",
354-
>>>>>>> update chapter 21 with the newest version from original author
355342
"\n",
356343
"# estimate the CATE\n",
357344
"t_learner_cate_train = m1.predict(train[X]) - m0.predict(train[X])\n",
@@ -596,9 +583,9 @@
596583
"metadata": {
597584
"celltoolbar": "Tags",
598585
"kernelspec": {
599-
"display_name": "Python 3",
586+
"display_name": "Python [conda env:base] *",
600587
"language": "python",
601-
"name": "python3"
588+
"name": "conda-base-py"
602589
},
603590
"language_info": {
604591
"codemirror_mode": {
@@ -610,11 +597,7 @@
610597
"name": "python",
611598
"nbconvert_exporter": "python",
612599
"pygments_lexer": "ipython3",
613-
<<<<<<< e022085c519423acf68e0d4c26b60d477788305d
614-
"version": "3.8.5"
615-
=======
616-
"version": "3.7.15"
617-
>>>>>>> update chapter 21 with the newest version from original author
600+
"version": "3.12.3"
618601
}
619602
},
620603
"nbformat": 4,

0 commit comments

Comments
 (0)