update lecture noets

This commit is contained in:
Morten Hjorth-Jensen
2024-10-14 13:40:08 +02:00
parent c6919fa39c
commit 1e5bce49e4
40 changed files with 1450 additions and 504 deletions
+7 -7
View File
@@ -10,13 +10,13 @@ edge [fontname="helvetica"] ;
2 -> 3 ;
4 [label="gini = 0.0\nsamples = 239\nvalue = [[239, 0]\n[0, 239]]", fillcolor="#e58139"] ;
3 -> 4 ;
5 [label="mean radius <= 12.265\ngini = 0.444\nsamples = 3\nvalue = [[2, 1]\n[1, 2]]", fillcolor="#fdf6f0"] ;
5 [label="worst area <= 566.55\ngini = 0.444\nsamples = 3\nvalue = [[2, 1]\n[1, 2]]", fillcolor="#fdf6f0"] ;
3 -> 5 ;
6 [label="gini = 0.0\nsamples = 1\nvalue = [[0, 1]\n[1, 0]]", fillcolor="#e58139"] ;
5 -> 6 ;
7 [label="gini = 0.0\nsamples = 2\nvalue = [[2, 0]\n[0, 2]]", fillcolor="#e58139"] ;
5 -> 7 ;
8 [label="mean texture <= 20.84\ngini = 0.397\nsamples = 11\nvalue = [[8, 3]\n[3, 8]]", fillcolor="#fae9dd"] ;
8 [label="worst texture <= 29.455\ngini = 0.397\nsamples = 11\nvalue = [[8, 3]\n[3, 8]]", fillcolor="#fae9dd"] ;
2 -> 8 ;
9 [label="gini = 0.0\nsamples = 8\nvalue = [[8, 0]\n[0, 8]]", fillcolor="#e58139"] ;
8 -> 9 ;
@@ -30,11 +30,11 @@ edge [fontname="helvetica"] ;
11 -> 13 ;
14 [label="worst texture <= 20.645\ngini = 0.202\nsamples = 167\nvalue = [[19, 148]\n[148, 19]]", fillcolor="#f0b68c"] ;
0 -> 14 [labeldistance=2.5, labelangle=-45, headlabel="False"] ;
15 [label="worst area <= 964.4\ngini = 0.375\nsamples = 16\nvalue = [[12, 4]\n[4, 12]]", fillcolor="#f9e3d4"] ;
15 [label="worst perimeter <= 116.8\ngini = 0.375\nsamples = 16\nvalue = [[12, 4]\n[4, 12]]", fillcolor="#f9e3d4"] ;
14 -> 15 ;
16 [label="gini = 0.0\nsamples = 11\nvalue = [[11, 0]\n[0, 11]]", fillcolor="#e58139"] ;
15 -> 16 ;
17 [label="worst texture <= 18.445\ngini = 0.32\nsamples = 5\nvalue = [[1, 4]\n[4, 1]]", fillcolor="#f6d5bd"] ;
17 [label="worst concave points <= 0.104\ngini = 0.32\nsamples = 5\nvalue = [[1, 4]\n[4, 1]]", fillcolor="#f6d5bd"] ;
15 -> 17 ;
18 [label="gini = 0.0\nsamples = 1\nvalue = [[1, 0]\n[0, 1]]", fillcolor="#e58139"] ;
17 -> 18 ;
@@ -48,10 +48,10 @@ edge [fontname="helvetica"] ;
21 -> 22 ;
23 [label="gini = 0.0\nsamples = 6\nvalue = [[6, 0]\n[0, 6]]", fillcolor="#e58139"] ;
21 -> 23 ;
24 [label="worst smoothness <= 0.096\ngini = 0.015\nsamples = 136\nvalue = [[1, 135]\n[135, 1]]", fillcolor="#e6853f"] ;
24 [label="fractal dimension error <= 0.013\ngini = 0.015\nsamples = 136\nvalue = [[1, 135]\n[135, 1]]", fillcolor="#e6853f"] ;
20 -> 24 ;
25 [label="gini = 0.0\nsamples = 1\nvalue = [[1, 0]\n[0, 1]]", fillcolor="#e58139"] ;
25 [label="gini = 0.0\nsamples = 135\nvalue = [[0, 135]\n[135, 0]]", fillcolor="#e58139"] ;
24 -> 25 ;
26 [label="gini = 0.0\nsamples = 135\nvalue = [[0, 135]\n[135, 0]]", fillcolor="#e58139"] ;
26 [label="gini = 0.0\nsamples = 1\nvalue = [[1, 0]\n[0, 1]]", fillcolor="#e58139"] ;
24 -> 26 ;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 KiB

After

Width:  |  Height:  |  Size: 244 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -2994,19 +2994,20 @@
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/tracer.py:10\u001b[0m, in \u001b[0;36mtrace\u001b[0;34m(start_node, fun, x)\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m trace_stack\u001b[38;5;241m.\u001b[39mnew_trace() \u001b[38;5;28;01mas\u001b[39;00m t:\n\u001b[1;32m 9\u001b[0m start_box \u001b[38;5;241m=\u001b[39m new_box(x, t, start_node)\n\u001b[0;32m---> 10\u001b[0m end_box \u001b[38;5;241m=\u001b[39m \u001b[43mfun\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstart_box\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 11\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m isbox(end_box) \u001b[38;5;129;01mand\u001b[39;00m end_box\u001b[38;5;241m.\u001b[39m_trace \u001b[38;5;241m==\u001b[39m start_box\u001b[38;5;241m.\u001b[39m_trace:\n\u001b[1;32m 12\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m end_box\u001b[38;5;241m.\u001b[39m_value, end_box\u001b[38;5;241m.\u001b[39m_node\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/wrap_util.py:15\u001b[0m, in \u001b[0;36munary_to_nary.<locals>.nary_operator.<locals>.nary_f.<locals>.unary_f\u001b[0;34m(x)\u001b[0m\n\u001b[1;32m 13\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 14\u001b[0m subargs \u001b[38;5;241m=\u001b[39m subvals(args, \u001b[38;5;28mzip\u001b[39m(argnum, x))\n\u001b[0;32m---> 15\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfun\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43msubargs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/wrap_util.py:20\u001b[0m, in \u001b[0;36munary_to_nary.<locals>.nary_operator.<locals>.nary_f\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 18\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 19\u001b[0m x \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mtuple\u001b[39m(args[i] \u001b[38;5;28;01mfor\u001b[39;00m i \u001b[38;5;129;01min\u001b[39;00m argnum)\n\u001b[0;32m---> 20\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43munary_operator\u001b[49m\u001b[43m(\u001b[49m\u001b[43munary_f\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mx\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mnary_op_args\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mnary_op_kwargs\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/differential_operators.py:64\u001b[0m, in \u001b[0;36mjacobian\u001b[0;34m(fun, x)\u001b[0m\n\u001b[1;32m 62\u001b[0m jacobian_shape \u001b[38;5;241m=\u001b[39m ans_vspace\u001b[38;5;241m.\u001b[39mshape \u001b[38;5;241m+\u001b[39m vspace(x)\u001b[38;5;241m.\u001b[39mshape\n\u001b[1;32m 63\u001b[0m grads \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mmap\u001b[39m(vjp, ans_vspace\u001b[38;5;241m.\u001b[39mstandard_basis())\n\u001b[0;32m---> 64\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m np\u001b[38;5;241m.\u001b[39mreshape(\u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstack\u001b[49m\u001b[43m(\u001b[49m\u001b[43mgrads\u001b[49m\u001b[43m)\u001b[49m, jacobian_shape)\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/numpy/numpy_wrapper.py:88\u001b[0m, in \u001b[0;36mstack\u001b[0;34m(arrays, axis)\u001b[0m\n\u001b[1;32m 83\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mstack\u001b[39m(arrays, axis\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0\u001b[39m):\n\u001b[1;32m 84\u001b[0m \u001b[38;5;66;03m# this code is basically copied from numpy/core/shape_base.py's stack\u001b[39;00m\n\u001b[1;32m 85\u001b[0m \u001b[38;5;66;03m# we need it here because we want to re-implement stack in terms of the\u001b[39;00m\n\u001b[1;32m 86\u001b[0m \u001b[38;5;66;03m# primitives defined in this file\u001b[39;00m\n\u001b[0;32m---> 88\u001b[0m arrays \u001b[38;5;241m=\u001b[39m [array(arr) \u001b[38;5;28;01mfor\u001b[39;00m arr \u001b[38;5;129;01min\u001b[39;00m arrays]\n\u001b[1;32m 89\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m arrays:\n\u001b[1;32m 90\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mneed at least one array to stack\u001b[39m\u001b[38;5;124m'\u001b[39m)\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/numpy/numpy_wrapper.py:88\u001b[0m, in \u001b[0;36m<listcomp>\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 83\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mstack\u001b[39m(arrays, axis\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0\u001b[39m):\n\u001b[1;32m 84\u001b[0m \u001b[38;5;66;03m# this code is basically copied from numpy/core/shape_base.py's stack\u001b[39;00m\n\u001b[1;32m 85\u001b[0m \u001b[38;5;66;03m# we need it here because we want to re-implement stack in terms of the\u001b[39;00m\n\u001b[1;32m 86\u001b[0m \u001b[38;5;66;03m# primitives defined in this file\u001b[39;00m\n\u001b[0;32m---> 88\u001b[0m arrays \u001b[38;5;241m=\u001b[39m [array(arr) \u001b[38;5;28;01mfor\u001b[39;00m arr \u001b[38;5;129;01min\u001b[39;00m arrays]\n\u001b[1;32m 89\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m arrays:\n\u001b[1;32m 90\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mneed at least one array to stack\u001b[39m\u001b[38;5;124m'\u001b[39m)\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/core.py:14\u001b[0m, in \u001b[0;36mmake_vjp.<locals>.vjp\u001b[0;34m(g)\u001b[0m\n\u001b[0;32m---> 14\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mvjp\u001b[39m(g): \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mbackward_pass\u001b[49m\u001b[43m(\u001b[49m\u001b[43mg\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mend_node\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/core.py:21\u001b[0m, in \u001b[0;36mbackward_pass\u001b[0;34m(g, end_node)\u001b[0m\n\u001b[1;32m 19\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m node \u001b[38;5;129;01min\u001b[39;00m toposort(end_node):\n\u001b[1;32m 20\u001b[0m outgrad \u001b[38;5;241m=\u001b[39m outgrads\u001b[38;5;241m.\u001b[39mpop(node)\n\u001b[0;32m---> 21\u001b[0m ingrads \u001b[38;5;241m=\u001b[39m \u001b[43mnode\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mvjp\u001b[49m\u001b[43m(\u001b[49m\u001b[43moutgrad\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 22\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m parent, ingrad \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mzip\u001b[39m(node\u001b[38;5;241m.\u001b[39mparents, ingrads):\n\u001b[1;32m 23\u001b[0m outgrads[parent] \u001b[38;5;241m=\u001b[39m add_outgrads(outgrads\u001b[38;5;241m.\u001b[39mget(parent), ingrad)\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/core.py:67\u001b[0m, in \u001b[0;36mdefvjp.<locals>.vjp_argnums.<locals>.<lambda>\u001b[0;34m(g)\u001b[0m\n\u001b[1;32m 64\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mNotImplementedError\u001b[39;00m(\n\u001b[1;32m 65\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mVJP of \u001b[39m\u001b[38;5;132;01m{}\u001b[39;00m\u001b[38;5;124m wrt argnum 0 not defined\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(fun\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__name__\u001b[39m))\n\u001b[1;32m 66\u001b[0m vjp \u001b[38;5;241m=\u001b[39m vjpfun(ans, \u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m---> 67\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mlambda\u001b[39;00m g: (\u001b[43mvjp\u001b[49m\u001b[43m(\u001b[49m\u001b[43mg\u001b[49m\u001b[43m)\u001b[49m,)\n\u001b[1;32m 68\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m L \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m2\u001b[39m:\n\u001b[1;32m 69\u001b[0m argnum_0, argnum_1 \u001b[38;5;241m=\u001b[39m argnums\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/numpy/numpy_vjps.py:423\u001b[0m, in \u001b[0;36mmatmul_vjp_1.<locals>.<lambda>\u001b[0;34m(g)\u001b[0m\n\u001b[1;32m 421\u001b[0m A_ndim \u001b[38;5;241m=\u001b[39m anp\u001b[38;5;241m.\u001b[39mndim(A)\n\u001b[1;32m 422\u001b[0m B_meta \u001b[38;5;241m=\u001b[39m anp\u001b[38;5;241m.\u001b[39mmetadata(B)\n\u001b[0;32m--> 423\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mlambda\u001b[39;00m g: \u001b[43mmatmul_adjoint_1\u001b[49m\u001b[43m(\u001b[49m\u001b[43mA\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mg\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mA_ndim\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mB_meta\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/numpy/numpy_vjps.py:413\u001b[0m, in \u001b[0;36mmatmul_adjoint_1\u001b[0;34m(A, G, A_ndim, B_meta)\u001b[0m\n\u001b[1;32m 411\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m B_is_vec:\n\u001b[1;32m 412\u001b[0m result \u001b[38;5;241m=\u001b[39m anp\u001b[38;5;241m.\u001b[39msqueeze(result, anp\u001b[38;5;241m.\u001b[39mndim(G) \u001b[38;5;241m-\u001b[39m \u001b[38;5;241m1\u001b[39m)\n\u001b[0;32m--> 413\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43munbroadcast\u001b[49m\u001b[43m(\u001b[49m\u001b[43mresult\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mB_meta\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/numpy/numpy_vjps.py:653\u001b[0m, in \u001b[0;36munbroadcast\u001b[0;34m(x, target_meta, broadcast_idx)\u001b[0m\n\u001b[1;32m 651\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m axis, size \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28menumerate\u001b[39m(target_shape):\n\u001b[1;32m 652\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m size \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m1\u001b[39m:\n\u001b[0;32m--> 653\u001b[0m x \u001b[38;5;241m=\u001b[39m \u001b[43manp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msum\u001b[49m\u001b[43m(\u001b[49m\u001b[43mx\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43maxis\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkeepdims\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m)\u001b[49m\n\u001b[1;32m 654\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m anp\u001b[38;5;241m.\u001b[39miscomplexobj(x) \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m target_iscomplex:\n\u001b[1;32m 655\u001b[0m x \u001b[38;5;241m=\u001b[39m anp\u001b[38;5;241m.\u001b[39mreal(x)\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/differential_operators.py:60\u001b[0m, in \u001b[0;36mjacobian\u001b[0;34m(fun, x)\u001b[0m\n\u001b[1;32m 50\u001b[0m \u001b[38;5;129m@unary_to_nary\u001b[39m\n\u001b[1;32m 51\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mjacobian\u001b[39m(fun, x):\n\u001b[1;32m 52\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 53\u001b[0m \u001b[38;5;124;03m Returns a function which computes the Jacobian of `fun` with respect to\u001b[39;00m\n\u001b[1;32m 54\u001b[0m \u001b[38;5;124;03m positional argument number `argnum`, which must be a scalar or array. Unlike\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 58\u001b[0m \u001b[38;5;124;03m (out1, out2, ...) then the Jacobian has shape (out1, out2, ..., in1, in2, ...).\u001b[39;00m\n\u001b[1;32m 59\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m---> 60\u001b[0m vjp, ans \u001b[38;5;241m=\u001b[39m \u001b[43m_make_vjp\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfun\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mx\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 61\u001b[0m ans_vspace \u001b[38;5;241m=\u001b[39m vspace(ans)\n\u001b[1;32m 62\u001b[0m jacobian_shape \u001b[38;5;241m=\u001b[39m ans_vspace\u001b[38;5;241m.\u001b[39mshape \u001b[38;5;241m+\u001b[39m vspace(x)\u001b[38;5;241m.\u001b[39mshape\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/core.py:10\u001b[0m, in \u001b[0;36mmake_vjp\u001b[0;34m(fun, x)\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mmake_vjp\u001b[39m(fun, x):\n\u001b[1;32m 9\u001b[0m start_node \u001b[38;5;241m=\u001b[39m VJPNode\u001b[38;5;241m.\u001b[39mnew_root()\n\u001b[0;32m---> 10\u001b[0m end_value, end_node \u001b[38;5;241m=\u001b[39m \u001b[43mtrace\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstart_node\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfun\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mx\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 11\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m end_node \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 12\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mvjp\u001b[39m(g): \u001b[38;5;28;01mreturn\u001b[39;00m vspace(x)\u001b[38;5;241m.\u001b[39mzeros()\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/tracer.py:10\u001b[0m, in \u001b[0;36mtrace\u001b[0;34m(start_node, fun, x)\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m trace_stack\u001b[38;5;241m.\u001b[39mnew_trace() \u001b[38;5;28;01mas\u001b[39;00m t:\n\u001b[1;32m 9\u001b[0m start_box \u001b[38;5;241m=\u001b[39m new_box(x, t, start_node)\n\u001b[0;32m---> 10\u001b[0m end_box \u001b[38;5;241m=\u001b[39m \u001b[43mfun\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstart_box\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 11\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m isbox(end_box) \u001b[38;5;129;01mand\u001b[39;00m end_box\u001b[38;5;241m.\u001b[39m_trace \u001b[38;5;241m==\u001b[39m start_box\u001b[38;5;241m.\u001b[39m_trace:\n\u001b[1;32m 12\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m end_box\u001b[38;5;241m.\u001b[39m_value, end_box\u001b[38;5;241m.\u001b[39m_node\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/wrap_util.py:15\u001b[0m, in \u001b[0;36munary_to_nary.<locals>.nary_operator.<locals>.nary_f.<locals>.unary_f\u001b[0;34m(x)\u001b[0m\n\u001b[1;32m 13\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 14\u001b[0m subargs \u001b[38;5;241m=\u001b[39m subvals(args, \u001b[38;5;28mzip\u001b[39m(argnum, x))\n\u001b[0;32m---> 15\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfun\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43msubargs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/wrap_util.py:15\u001b[0m, in \u001b[0;36munary_to_nary.<locals>.nary_operator.<locals>.nary_f.<locals>.unary_f\u001b[0;34m(x)\u001b[0m\n\u001b[1;32m 13\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 14\u001b[0m subargs \u001b[38;5;241m=\u001b[39m subvals(args, \u001b[38;5;28mzip\u001b[39m(argnum, x))\n\u001b[0;32m---> 15\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfun\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43msubargs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
"Cell \u001b[0;32mIn[9], line 61\u001b[0m, in \u001b[0;36mg_trial\u001b[0;34m(point, P)\u001b[0m\n\u001b[1;32m 59\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mg_trial\u001b[39m(point,P):\n\u001b[1;32m 60\u001b[0m x,t \u001b[38;5;241m=\u001b[39m point\n\u001b[0;32m---> 61\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m (\u001b[38;5;241m1\u001b[39m\u001b[38;5;241m-\u001b[39mt)\u001b[38;5;241m*\u001b[39mu(x) \u001b[38;5;241m+\u001b[39m x\u001b[38;5;241m*\u001b[39m(\u001b[38;5;241;43m1\u001b[39;49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[43mx\u001b[49m)\u001b[38;5;241m*\u001b[39mt\u001b[38;5;241m*\u001b[39mdeep_neural_network(P,point)\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/numpy/numpy_boxes.py:34\u001b[0m, in \u001b[0;36mArrayBox.__rsub__\u001b[0;34m(self, other)\u001b[0m\n\u001b[0;32m---> 34\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__rsub__\u001b[39m(\u001b[38;5;28mself\u001b[39m, other): \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43manp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msubtract\u001b[49m\u001b[43m(\u001b[49m\u001b[43mother\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/tracer.py:45\u001b[0m, in \u001b[0;36mprimitive.<locals>.f_wrapped\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 43\u001b[0m argnums \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mtuple\u001b[39m(argnum \u001b[38;5;28;01mfor\u001b[39;00m argnum, _ \u001b[38;5;129;01min\u001b[39;00m boxed_args)\n\u001b[1;32m 44\u001b[0m ans \u001b[38;5;241m=\u001b[39m f_wrapped(\u001b[38;5;241m*\u001b[39margvals, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m---> 45\u001b[0m node \u001b[38;5;241m=\u001b[39m \u001b[43mnode_constructor\u001b[49m\u001b[43m(\u001b[49m\u001b[43mans\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mf_wrapped\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43margvals\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43margnums\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mparents\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 46\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m new_box(ans, trace, node)\n\u001b[1;32m 47\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/core.py:36\u001b[0m, in \u001b[0;36mVJPNode.__init__\u001b[0;34m(self, value, fun, args, kwargs, parent_argnums, parents)\u001b[0m\n\u001b[1;32m 33\u001b[0m fun_name \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mgetattr\u001b[39m(fun, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m__name__\u001b[39m\u001b[38;5;124m'\u001b[39m, fun)\n\u001b[1;32m 34\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mNotImplementedError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mVJP of \u001b[39m\u001b[38;5;132;01m{}\u001b[39;00m\u001b[38;5;124m wrt argnums \u001b[39m\u001b[38;5;132;01m{}\u001b[39;00m\u001b[38;5;124m not defined\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 35\u001b[0m \u001b[38;5;241m.\u001b[39mformat(fun_name, parent_argnums))\n\u001b[0;32m---> 36\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mvjp \u001b[38;5;241m=\u001b[39m \u001b[43mvjpmaker\u001b[49m\u001b[43m(\u001b[49m\u001b[43mparent_argnums\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/core.py:66\u001b[0m, in \u001b[0;36mdefvjp.<locals>.vjp_argnums\u001b[0;34m(argnums, ans, args, kwargs)\u001b[0m\n\u001b[1;32m 63\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mKeyError\u001b[39;00m:\n\u001b[1;32m 64\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mNotImplementedError\u001b[39;00m(\n\u001b[1;32m 65\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mVJP of \u001b[39m\u001b[38;5;132;01m{}\u001b[39;00m\u001b[38;5;124m wrt argnum 0 not defined\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(fun\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__name__\u001b[39m))\n\u001b[0;32m---> 66\u001b[0m vjp \u001b[38;5;241m=\u001b[39m \u001b[43mvjpfun\u001b[49m\u001b[43m(\u001b[49m\u001b[43mans\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 67\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mlambda\u001b[39;00m g: (vjp(g),)\n\u001b[1;32m 68\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m L \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m2\u001b[39m:\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/numpy/numpy_vjps.py:297\u001b[0m, in \u001b[0;36mgrad_np_sum\u001b[0;34m(ans, x, axis, keepdims, dtype)\u001b[0m\n\u001b[1;32m 294\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mlambda\u001b[39;00m g: anp\u001b[38;5;241m.\u001b[39msum(g, axis\u001b[38;5;241m=\u001b[39mbroadcast_axes, keepdims\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m)\n\u001b[1;32m 295\u001b[0m defvjp(anp\u001b[38;5;241m.\u001b[39mbroadcast_to, grad_broadcast_to)\n\u001b[0;32m--> 297\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mgrad_np_sum\u001b[39m(ans, x, axis\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m, keepdims\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m, dtype\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m):\n\u001b[1;32m 298\u001b[0m shape, dtype \u001b[38;5;241m=\u001b[39m anp\u001b[38;5;241m.\u001b[39mshape(x), anp\u001b[38;5;241m.\u001b[39mresult_type(x)\n\u001b[1;32m 299\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mlambda\u001b[39;00m g: repeat_to_match_shape(g, shape, dtype, axis, keepdims)[\u001b[38;5;241m0\u001b[39m]\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/numpy/numpy_vjps.py:37\u001b[0m, in \u001b[0;36m<lambda>\u001b[0;34m(ans, x, y)\u001b[0m\n\u001b[1;32m 32\u001b[0m defvjp(anp\u001b[38;5;241m.\u001b[39madd, \u001b[38;5;28;01mlambda\u001b[39;00m ans, x, y : unbroadcast_f(x, \u001b[38;5;28;01mlambda\u001b[39;00m g: g),\n\u001b[1;32m 33\u001b[0m \u001b[38;5;28;01mlambda\u001b[39;00m ans, x, y : unbroadcast_f(y, \u001b[38;5;28;01mlambda\u001b[39;00m g: g))\n\u001b[1;32m 34\u001b[0m defvjp(anp\u001b[38;5;241m.\u001b[39mmultiply, \u001b[38;5;28;01mlambda\u001b[39;00m ans, x, y : unbroadcast_f(x, \u001b[38;5;28;01mlambda\u001b[39;00m g: y \u001b[38;5;241m*\u001b[39m g),\n\u001b[1;32m 35\u001b[0m \u001b[38;5;28;01mlambda\u001b[39;00m ans, x, y : unbroadcast_f(y, \u001b[38;5;28;01mlambda\u001b[39;00m g: x \u001b[38;5;241m*\u001b[39m g))\n\u001b[1;32m 36\u001b[0m defvjp(anp\u001b[38;5;241m.\u001b[39msubtract, \u001b[38;5;28;01mlambda\u001b[39;00m ans, x, y : unbroadcast_f(x, \u001b[38;5;28;01mlambda\u001b[39;00m g: g),\n\u001b[0;32m---> 37\u001b[0m \u001b[38;5;28;01mlambda\u001b[39;00m ans, x, y : \u001b[43munbroadcast_f\u001b[49m\u001b[43m(\u001b[49m\u001b[43my\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mlambda\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mg\u001b[49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[43mg\u001b[49m\u001b[43m)\u001b[49m)\n\u001b[1;32m 38\u001b[0m defvjp(anp\u001b[38;5;241m.\u001b[39mdivide, \u001b[38;5;28;01mlambda\u001b[39;00m ans, x, y : unbroadcast_f(x, \u001b[38;5;28;01mlambda\u001b[39;00m g: g \u001b[38;5;241m/\u001b[39m y),\n\u001b[1;32m 39\u001b[0m \u001b[38;5;28;01mlambda\u001b[39;00m ans, x, y : unbroadcast_f(y, \u001b[38;5;28;01mlambda\u001b[39;00m g: \u001b[38;5;241m-\u001b[39m g \u001b[38;5;241m*\u001b[39m x \u001b[38;5;241m/\u001b[39m y\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m2\u001b[39m))\n\u001b[1;32m 40\u001b[0m defvjp(anp\u001b[38;5;241m.\u001b[39mmaximum, \u001b[38;5;28;01mlambda\u001b[39;00m ans, x, y : unbroadcast_f(x, \u001b[38;5;28;01mlambda\u001b[39;00m g: g \u001b[38;5;241m*\u001b[39m balanced_eq(x, ans, y)),\n\u001b[1;32m 41\u001b[0m \u001b[38;5;28;01mlambda\u001b[39;00m ans, x, y : unbroadcast_f(y, \u001b[38;5;28;01mlambda\u001b[39;00m g: g \u001b[38;5;241m*\u001b[39m balanced_eq(y, ans, x)))\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/numpy/numpy_vjps.py:659\u001b[0m, in \u001b[0;36munbroadcast_f\u001b[0;34m(target, f)\u001b[0m\n\u001b[1;32m 658\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21munbroadcast_f\u001b[39m(target, f):\n\u001b[0;32m--> 659\u001b[0m target_meta \u001b[38;5;241m=\u001b[39m \u001b[43manp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmetadata\u001b[49m\u001b[43m(\u001b[49m\u001b[43mtarget\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 660\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mlambda\u001b[39;00m g: unbroadcast(f(g), target_meta)\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/tracer.py:61\u001b[0m, in \u001b[0;36mnotrace_primitive.<locals>.f_wrapped\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 58\u001b[0m \u001b[38;5;129m@wraps\u001b[39m(f_raw)\n\u001b[1;32m 59\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mf_wrapped\u001b[39m(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[1;32m 60\u001b[0m argvals \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mmap\u001b[39m(getval, args)\n\u001b[0;32m---> 61\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mf_raw\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margvals\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/autograd/numpy/numpy_wrapper.py:148\u001b[0m, in \u001b[0;36mmetadata\u001b[0;34m(A)\u001b[0m\n\u001b[1;32m 146\u001b[0m \u001b[38;5;129m@notrace_primitive\u001b[39m\n\u001b[1;32m 147\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mmetadata\u001b[39m(A):\n\u001b[0;32m--> 148\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_np\u001b[49m\u001b[38;5;241m.\u001b[39mshape(A), _np\u001b[38;5;241m.\u001b[39mndim(A), _np\u001b[38;5;241m.\u001b[39mresult_type(A), _np\u001b[38;5;241m.\u001b[39miscomplexobj(A)\n",
"\u001b[0;31mKeyboardInterrupt\u001b[0m: "
]
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

@@ -1798,10 +1798,10 @@
"name": "stdout",
"output_type": "stream",
"text": [
"0.04718566894028431\n",
"4.11080997912276\n",
"[[ 1.10517643 3.48455788]\n",
" [ 3.48455788 12.00216162]]\n"
"-0.014394967608286841\n",
"4.011594819155615\n",
"[[ 1.24508783 3.8595836 ]\n",
" [ 3.8595836 12.92663007]]\n"
]
}
],
@@ -1845,10 +1845,10 @@
"name": "stdout",
"output_type": "stream",
"text": [
"0.07836997022107646\n",
"1.1378267322316808\n",
"[[1. 0.63980097]\n",
" [0.63980097 1. ]]\n"
"0.07630326327869198\n",
"1.6893421391051477\n",
"[[1. 0.6373454]\n",
" [0.6373454 1. ]]\n"
]
}
],
@@ -1905,30 +1905,30 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[[ 1.34931214 3.06139439]\n",
" [-0.44476964 -2.60794187]\n",
" [ 0.02225493 0.16388664]\n",
" [-1.91193672 -3.82324216]\n",
" [-0.2044881 -1.56027537]\n",
" [-1.15572395 -3.25982474]\n",
" [ 0.94217756 1.49888671]\n",
" [ 0.28472162 2.92474572]\n",
" [ 2.38943 7.14118216]\n",
" [-1.27097785 -3.5388115 ]]\n",
"[[ 0.20396326 0.93053605]\n",
" [ 0.51936974 2.03440431]\n",
" [-0.53851084 -1.2527027 ]\n",
" [-0.50429483 0.72966563]\n",
" [ 0.71314288 1.60421343]\n",
" [-0.29995377 -2.31356849]\n",
" [-0.14484831 -2.19932442]\n",
" [-0.00570826 -0.32643011]\n",
" [-0.22821607 0.56775345]\n",
" [ 0.28505619 0.22545286]]\n",
" 0 1\n",
"0 1.349312 3.061394\n",
"1 -0.444770 -2.607942\n",
"2 0.022255 0.163887\n",
"3 -1.911937 -3.823242\n",
"4 -0.204488 -1.560275\n",
"5 -1.155724 -3.259825\n",
"6 0.942178 1.498887\n",
"7 0.284722 2.924746\n",
"8 2.389430 7.141182\n",
"9 -1.270978 -3.538811\n",
" 0 1\n",
"0 1.000000 0.950873\n",
"1 0.950873 1.000000\n"
"0 0.203963 0.930536\n",
"1 0.519370 2.034404\n",
"2 -0.538511 -1.252703\n",
"3 -0.504295 0.729666\n",
"4 0.713143 1.604213\n",
"5 -0.299954 -2.313568\n",
"6 -0.144848 -2.199324\n",
"7 -0.005708 -0.326430\n",
"8 -0.228216 0.567753\n",
"9 0.285056 0.225453\n",
" 0 1\n",
"0 1.0000 0.6373\n",
"1 0.6373 1.0000\n"
]
}
],
@@ -1974,37 +1974,44 @@
"text": [
" 0 1 2 3 4 5 6 7 \\\n",
"0 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 \n",
"1 0.0 0.074334 0.080585 0.077061 0.078751 0.080220 0.070657 0.071406 \n",
"2 0.0 0.080585 0.088425 0.082009 0.084289 0.086338 0.074009 0.075052 \n",
"3 0.0 0.077061 0.082009 0.085147 0.086339 0.087297 0.081324 0.081796 \n",
"4 0.0 0.078751 0.084289 0.086339 0.087789 0.089007 0.081926 0.082537 \n",
"5 0.0 0.080220 0.086338 0.087297 0.089007 0.090492 0.082307 0.083061 \n",
"6 0.0 0.070657 0.074009 0.081324 0.081926 0.082307 0.079874 0.080032 \n",
"7 0.0 0.071406 0.075052 0.081796 0.082537 0.083061 0.080032 0.080271 \n",
"8 0.0 0.072148 0.076101 0.082240 0.083128 0.083801 0.080150 0.080474 \n",
"9 0.0 0.072902 0.077180 0.082670 0.083714 0.084548 0.080237 0.080651 \n",
"10 0.0 0.063646 0.065859 0.075320 0.075498 0.075472 0.075478 0.075409 \n",
"11 0.0 0.064071 0.066452 0.075576 0.075838 0.075897 0.075542 0.075525 \n",
"12 0.0 0.064514 0.067074 0.075838 0.076189 0.076340 0.075602 0.075639 \n",
"13 0.0 0.064980 0.067731 0.076108 0.076555 0.076803 0.075658 0.075753 \n",
"14 0.0 0.065472 0.068429 0.076389 0.076938 0.077292 0.075711 0.075868 \n",
"1 0.0 0.072835 0.076616 0.071253 0.074193 0.077337 0.063283 0.065305 \n",
"2 0.0 0.076616 0.082149 0.073794 0.077643 0.081811 0.064373 0.066929 \n",
"3 0.0 0.071253 0.073794 0.075423 0.077534 0.079745 0.070414 0.071978 \n",
"4 0.0 0.074193 0.077643 0.077534 0.080199 0.083034 0.071575 0.073483 \n",
"5 0.0 0.077337 0.081811 0.079745 0.083034 0.086576 0.072733 0.075028 \n",
"6 0.0 0.063283 0.064373 0.070414 0.071575 0.072733 0.068008 0.068984 \n",
"7 0.0 0.065305 0.066929 0.071978 0.073483 0.075028 0.068984 0.070181 \n",
"8 0.0 0.067523 0.069754 0.073667 0.075563 0.077550 0.070010 0.071459 \n",
"9 0.0 0.069964 0.072888 0.075496 0.077839 0.080330 0.071092 0.072826 \n",
"10 0.0 0.055866 0.055925 0.064324 0.064790 0.065183 0.063660 0.064182 \n",
"11 0.0 0.057298 0.057682 0.065508 0.066192 0.066830 0.064471 0.065139 \n",
"12 0.0 0.058866 0.059624 0.066786 0.067719 0.068637 0.065330 0.066162 \n",
"13 0.0 0.060590 0.061775 0.068171 0.069388 0.070625 0.066241 0.067260 \n",
"14 0.0 0.062489 0.064164 0.069675 0.071217 0.072820 0.067209 0.068440 \n",
"\n",
" 8 9 10 11 12 13 14 \n",
"0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 \n",
"1 0.072148 0.072902 0.063646 0.064071 0.064514 0.064980 0.065472 \n",
"2 0.076101 0.077180 0.065859 0.066452 0.067074 0.067731 0.068429 \n",
"3 0.082240 0.082670 0.075320 0.075576 0.075838 0.076108 0.076389 \n",
"4 0.083128 0.083714 0.075498 0.075838 0.076189 0.076555 0.076938 \n",
"5 0.083801 0.084548 0.075472 0.075897 0.076340 0.076803 0.077292 \n",
"6 0.080150 0.080237 0.075478 0.075542 0.075602 0.075658 0.075711 \n",
"7 0.080474 0.080651 0.075409 0.075525 0.075639 0.075753 0.075868 \n",
"8 0.080766 0.081038 0.075293 0.075463 0.075634 0.075809 0.075988 \n",
"9 0.081038 0.081411 0.075136 0.075363 0.075595 0.075834 0.076082 \n",
"10 0.075293 0.075136 0.072406 0.072329 0.072240 0.072140 0.072028 \n",
"11 0.075463 0.075363 0.072329 0.072286 0.072234 0.072173 0.072101 \n",
"12 0.075634 0.075595 0.072240 0.072234 0.072220 0.072199 0.072171 \n",
"13 0.075809 0.075834 0.072140 0.072173 0.072199 0.072221 0.072238 \n",
"14 0.075988 0.076082 0.072028 0.072101 0.072171 0.072238 0.072303 \n"
"1 0.067523 0.069964 0.055866 0.057298 0.058866 0.060590 0.062489 \n",
"2 0.069754 0.072888 0.055925 0.057682 0.059624 0.061775 0.064164 \n",
"3 0.073667 0.075496 0.064324 0.065508 0.066786 0.068171 0.069675 \n",
"4 0.075563 0.077839 0.064790 0.066192 0.067719 0.069388 0.071217 \n",
"5 0.077550 0.080330 0.065183 0.066830 0.068637 0.070625 0.072820 \n",
"6 0.070010 0.071092 0.063660 0.064471 0.065330 0.066241 0.067209 \n",
"7 0.071459 0.072826 0.064182 0.065139 0.066162 0.067260 0.068440 \n",
"8 0.073021 0.074713 0.064703 0.065823 0.067032 0.068341 0.069761 \n",
"9 0.074713 0.076776 0.065219 0.066524 0.067943 0.069492 0.071186 \n",
"10 0.064703 0.065219 0.060678 0.061187 0.061707 0.062241 0.062786 \n",
"11 0.065823 0.066524 0.061187 0.061793 0.062424 0.063082 0.063768 \n",
"12 0.067032 0.067943 0.061707 0.062424 0.063180 0.063978 0.064823 \n",
"13 0.068341 0.069492 0.062241 0.063082 0.063978 0.064935 0.065960 \n",
"14 0.069761 0.071186 0.062786 0.063768 0.064823 0.065960 0.067192 "
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n"
]
}
],
@@ -3557,14 +3564,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[2. 2.]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"[2. 2.]\n",
"Training MSE for OLS\n",
"3.0\n"
]
@@ -3578,7 +3578,7 @@
},
"metadata": {
"filenames": {
"image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter2_252_2.png"
"image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter2_252_1.png"
}
},
"output_type": "display_data"
File diff suppressed because one or more lines are too long
Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

File diff suppressed because one or more lines are too long
Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

File diff suppressed because one or more lines are too long
Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 34 KiB

File diff suppressed because one or more lines are too long
Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

@@ -225,8 +225,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[ 1.34851141 0.11232457 -0.59560497 0.79558423 -0.74632311 0.97068015\n",
" 1.45921927 0.39225935 -0.87171492 0.44129766]\n"
"[-0.03609183 1.12393064 -0.46049816 0.86567539 2.03530044 0.18872206\n",
" 0.67747547 -1.387672 0.30136959 -0.51164347]\n"
]
}
],
@@ -662,36 +662,26 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[[6.95039348e-01 4.77602426e-01 4.58218587e-02 7.93416236e-01\n",
" 9.55643340e-01 7.98621772e-01 4.69806017e-01 1.11371176e-01\n",
" 6.52359414e-01 4.86833907e-01]\n",
" [6.34549184e-01 4.06225028e-01 6.55208611e-01 1.10909182e-02\n",
" 6.45609936e-01 2.42839645e-01 2.14335140e-01 4.88477745e-01\n",
" 7.33046180e-01 3.04253288e-01]\n",
" [9.24911588e-01 6.09812323e-01 3.17886464e-01 8.85018556e-01\n",
" 9.82435177e-01 9.43167881e-01 7.43951798e-01 7.31787864e-01\n",
" 4.80369722e-01 8.57475388e-01]\n",
" [1.16436977e-01 8.00829346e-01 3.64493447e-01 4.94082113e-02\n",
" 5.68163369e-01 4.84993546e-03 2.34121963e-01 2.49849206e-01\n",
" 3.86274590e-01 8.78949699e-01]\n",
" [4.91568958e-01 9.21047414e-02 7.84745063e-01 6.96054705e-01\n",
" 6.19052323e-02 8.28645331e-01 8.30191327e-01 2.48853875e-01\n",
" 7.24382159e-01 3.97218946e-01]\n",
" [3.79942527e-01 1.36403018e-02 7.08949703e-02 5.98556486e-01\n",
" 5.10274274e-01 5.86030593e-01 8.96762953e-02 9.27993904e-01\n",
" 5.79873884e-01 4.12085937e-01]\n",
" [4.75733813e-01 3.83164611e-01 9.64968814e-01 2.10369090e-01\n",
" 6.15338896e-04 5.29509520e-01 4.33492417e-01 9.06496916e-01\n",
" 1.39646454e-01 4.21846767e-01]\n",
" [1.24848631e-01 9.48875568e-01 8.00598510e-01 4.10923006e-01\n",
" 9.72407267e-01 9.52121734e-01 1.56665044e-01 5.06276815e-01\n",
" 5.30196557e-01 8.40012736e-01]\n",
" [3.25145374e-01 1.83317854e-01 7.66763324e-02 9.66707072e-01\n",
" 8.23006632e-01 4.30655251e-01 4.69811070e-02 8.72758060e-01\n",
" 6.59088350e-01 7.28365323e-01]\n",
" [5.96282505e-01 9.69432059e-01 1.10687432e-01 9.36439409e-01\n",
" 1.82212861e-01 9.15905706e-01 4.35826030e-01 3.89219980e-01\n",
" 4.21786054e-01 4.13799037e-02]]\n"
"[[0.58452753 0.23142852 0.47865692 0.18572822 0.31436277 0.90536337\n",
" 0.4096949 0.68748147 0.94493877 0.97696399]\n",
" [0.95000259 0.40310129 0.74533876 0.01597958 0.74471533 0.36031586\n",
" 0.12031117 0.72690169 0.49008744 0.43492736]\n",
" [0.05224627 0.62033782 0.14697641 0.34601775 0.97622642 0.8644215\n",
" 0.24629299 0.5128288 0.24777879 0.43007284]\n",
" [0.76134837 0.76159011 0.55582327 0.81598832 0.40209956 0.31639624\n",
" 0.20393163 0.87700882 0.11331834 0.20621146]\n",
" [0.00922905 0.79619113 0.72444668 0.05605667 0.38949027 0.92292668\n",
" 0.84659427 0.10325557 0.55170845 0.63144217]\n",
" [0.25206089 0.00866766 0.06506624 0.53397188 0.25345918 0.67527216\n",
" 0.6696885 0.29142853 0.78198192 0.10425587]\n",
" [0.72882234 0.32052031 0.58799372 0.04235439 0.60740312 0.12152902\n",
" 0.17158357 0.79041505 0.22523018 0.63353014]\n",
" [0.13518746 0.54977724 0.1793636 0.31983943 0.12702643 0.3265097\n",
" 0.81592028 0.53488344 0.51698843 0.81385326]\n",
" [0.85786373 0.84416298 0.775204 0.84047912 0.21501369 0.66603461\n",
" 0.53869015 0.88147037 0.06512065 0.38535182]\n",
" [0.60586595 0.55084297 0.9202867 0.39376038 0.50558976 0.09347829\n",
" 0.50861923 0.79443618 0.17728993 0.29414225]]\n"
]
}
],
@@ -810,13 +800,13 @@
"name": "stdout",
"output_type": "stream",
"text": [
"0.11406297261341168\n",
"4.669908227073521\n",
"0.2806901924685401\n",
"[[ 0.98292239 2.97664837 2.73565966]\n",
" [ 2.97664837 10.21905519 8.21690241]\n",
" [ 2.73565966 8.21690241 13.03354844]]\n",
"[20.77597019 0.09165112 3.36790471]\n"
"0.0684990216069429\n",
"4.3391965479837245\n",
"0.32336220689648504\n",
"[[0.81091776 2.49361065 1.78904605]\n",
" [2.49361065 8.68609856 5.49742477]\n",
" [1.78904605 5.49742477 6.25106936]]\n",
"[13.8211787 0.07429213 1.85261484]\n"
]
}
],
File diff suppressed because one or more lines are too long
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

@@ -874,8 +874,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[ 1.81737781 0.45847011 0.53332849 1.04937026 0.53235952 2.24033384\n",
" -0.05605892 -0.02193078 -0.37343957 0.17849836]\n"
"[ 2.69749114 -0.06437266 0.55440601 -0.59770229 1.83671148 0.02661264\n",
" -1.45840653 1.96917669 0.32786329 -1.51690815]\n"
]
}
],
@@ -1313,26 +1313,26 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[[0.15586219 0.68891428 0.38675231 0.63546905 0.97286326 0.423102\n",
" 0.42841423 0.3478095 0.66130478 0.63443371]\n",
" [0.88685415 0.82561703 0.56766321 0.43258818 0.99057275 0.40058341\n",
" 0.84581375 0.64630711 0.03266152 0.57599494]\n",
" [0.10145028 0.9074157 0.39386718 0.12831838 0.46242424 0.09280524\n",
" 0.88415819 0.26443391 0.55095316 0.85897711]\n",
" [0.69243548 0.33745439 0.14452065 0.29030256 0.8063779 0.60720029\n",
" 0.42914251 0.44895662 0.09310479 0.48442601]\n",
" [0.95152814 0.83294718 0.11005335 0.8758851 0.19375828 0.73888203\n",
" 0.83203197 0.69203997 0.65147818 0.35195241]\n",
" [0.21506004 0.24874378 0.31370028 0.9525328 0.71672791 0.05879106\n",
" 0.45007578 0.36388542 0.50937003 0.57854115]\n",
" [0.80033616 0.45273617 0.18038547 0.49557088 0.36209091 0.44512218\n",
" 0.84078641 0.28924386 0.99166852 0.22896144]\n",
" [0.77579275 0.83519517 0.40640797 0.66272614 0.18234499 0.97628064\n",
" 0.19808709 0.1280526 0.33700495 0.32114535]\n",
" [0.95462534 0.72047148 0.24512233 0.18474924 0.69169665 0.68763036\n",
" 0.8861811 0.54193001 0.87830277 0.79251831]\n",
" [0.13092444 0.41452482 0.40447213 0.89714357 0.25360039 0.80373997\n",
" 0.51279028 0.58161787 0.08742496 0.45104086]]\n"
"[[0.72863433 0.17780089 0.4565147 0.92353194 0.4565685 0.45408759\n",
" 0.55900177 0.02561386 0.63461575 0.70015185]\n",
" [0.52488859 0.52729975 0.49035757 0.2383703 0.9206617 0.2766892\n",
" 0.89708415 0.52998985 0.45993741 0.74506271]\n",
" [0.67036507 0.42813351 0.79628257 0.00872006 0.06083072 0.80873785\n",
" 0.74407544 0.32616922 0.81337164 0.97183244]\n",
" [0.23449217 0.64638876 0.5291335 0.03625417 0.47382705 0.03068149\n",
" 0.72365764 0.53228519 0.63483713 0.01924105]\n",
" [0.99849105 0.05293216 0.52012715 0.77037707 0.28836035 0.7080469\n",
" 0.91692081 0.50152186 0.08734023 0.69892546]\n",
" [0.96154578 0.52229337 0.78888045 0.59879372 0.38240257 0.55451651\n",
" 0.01380833 0.4659454 0.51857188 0.98893579]\n",
" [0.38422061 0.39516594 0.22569872 0.40434293 0.80846898 0.33300231\n",
" 0.45647803 0.60116948 0.55862544 0.20607165]\n",
" [0.50029371 0.11487977 0.17093974 0.40903389 0.40362686 0.63204599\n",
" 0.99864751 0.7033198 0.61402242 0.72219757]\n",
" [0.78025829 0.65744898 0.93708805 0.68532803 0.22974904 0.00166889\n",
" 0.33180288 0.26196737 0.62846663 0.4390092 ]\n",
" [0.23570126 0.11877604 0.81642349 0.76688358 0.82757017 0.92808577\n",
" 0.89790867 0.97165491 0.98806419 0.48333419]]\n"
]
}
],
@@ -1446,13 +1446,13 @@
"name": "stdout",
"output_type": "stream",
"text": [
"-0.0458524213754298\n",
"3.614161296466206\n",
"-0.22985907723809532\n",
"[[0.72589774 2.09219464 1.64672839]\n",
" [2.09219464 6.9187554 4.62198131]\n",
" [1.64672839 4.62198131 6.70530438]]\n",
"[12.05431945 0.07101262 2.22462544]\n"
"0.15294186382924843\n",
"4.473730000968826\n",
"0.7333854378748542\n",
"[[ 0.89730533 2.66990322 2.88518 ]\n",
" [ 2.66990322 8.78338459 8.44007188]\n",
" [ 2.88518 8.44007188 16.31799354]]\n",
"[22.48904404 0.06826275 3.44137667]\n"
]
}
],
@@ -1808,7 +1808,7 @@
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_57294/1326197715.py\u001b[0m in \u001b[0;36m?\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 6\u001b[0;31m new_hobbit = {'First Name': [\"Peregrin\"],\n\u001b[0m\u001b[1;32m 7\u001b[0m \u001b[0;34m'Last Name'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m\"Took\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[0;34m'Place of birth'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m\"Shire\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0;34m'Date of Birth T.A.'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;36m2990\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/var/folders/td/3yk470mj5p931p9dtkk0y6jw0000gn/T/ipykernel_59734/1326197715.py\u001b[0m in \u001b[0;36m?\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 6\u001b[0;31m new_hobbit = {'First Name': [\"Peregrin\"],\n\u001b[0m\u001b[1;32m 7\u001b[0m \u001b[0;34m'Last Name'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m\"Took\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[0;34m'Place of birth'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m\"Shire\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0;34m'Date of Birth T.A.'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;36m2990\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/miniforge3/envs/myenv/lib/python3.9/site-packages/pandas/core/generic.py\u001b[0m in \u001b[0;36m?\u001b[0;34m(self, name)\u001b[0m\n\u001b[1;32m 6200\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_accessors\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6201\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_info_axis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_can_hold_identifiers_and_holds_name\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6202\u001b[0m ):\n\u001b[1;32m 6203\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 6204\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mobject\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__getattribute__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m: 'DataFrame' object has no attribute 'append'"
]
@@ -1533,7 +1533,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"0.9953466931203151\n"
"0.9950865473984227\n"
]
}
],
@@ -1564,7 +1564,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"0.010175219431920396\n"
"0.009998596494598343\n"
]
}
],
@@ -1599,23 +1599,23 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[0.03699304 0.0218856 0.02021288 0.0334505 0.02960445 0.01369614\n",
" 0.00606112 0.01429853 0.01174937 0.02585059 0.02044223 0.00174884\n",
" 0.06133572 0.03159246 0.04435458 0.00125802 0.00100423 0.00230308\n",
" 0.01055384 0.02352843 0.06971862 0.01300036 0.00547332 0.05554795\n",
" 0.01142354 0.01181458 0.00148216 0.01419341 0.0305221 0.01272102\n",
" 0.01700746 0.01552039 0.01616657 0.10695771 0.00405576 0.02979087\n",
" 0.0529838 0.01420773 0.06220192 0.04104182 0.00653725 0.07170448\n",
" 0.00997215 0.02490769 0.02580654 0.01682317 0.03221473 0.01838531\n",
" 0.02028936 0.0064349 0.04323964 0.02705202 0.03692828 0.01975755\n",
" 0.05636265 0.02880987 0.05692207 0.04085864 0.01085261 0.01457889\n",
" 0.03418643 0.01919791 0.00101555 0.00636951 0.04217103 0.0476266\n",
" 0.01169528 0.04544327 0.00978267 0.04046984 0.0032882 0.02072876\n",
" 0.05526935 0.05461692 0.00877816 0.00724303 0.00045923 0.00059105\n",
" 0.00917881 0.04254787 0.08728977 0.04513394 0.01606644 0.08956994\n",
" 0.02687671 0.07449122 0.04497158 0.01713187 0.02553907 0.0397137\n",
" 0.03313193 0.00738299 0.01743124 0.02953975 0.01131825 0.0864086\n",
" 0.01925934 0.02439287 0.09331672 0.01721277]\n"
"[0.0442242 0.01222848 0.01176967 0.00562142 0.00392853 0.02034593\n",
" 0.01294799 0.07286621 0.00893112 0.00155695 0.03181997 0.00965205\n",
" 0.00523789 0.03510464 0.04098879 0.04626298 0.03733016 0.05632246\n",
" 0.02241952 0.03770824 0.05984726 0.00875286 0.04355106 0.01981665\n",
" 0.06929519 0.03426934 0.00410974 0.0142117 0.00099936 0.04030508\n",
" 0.05247827 0.05227563 0.02499437 0.01459912 0.00154737 0.03099794\n",
" 0.06159762 0.00052051 0.04268493 0.01479672 0.01149099 0.02280634\n",
" 0.04740084 0.00617261 0.00103024 0.00740838 0.00577229 0.00142146\n",
" 0.00140253 0.01112157 0.01180692 0.00039821 0.02257687 0.03196582\n",
" 0.01289266 0.03194307 0.00192165 0.08543112 0.01377529 0.06267966\n",
" 0.10637914 0.00872869 0.00331168 0.03291795 0.08933713 0.00786896\n",
" 0.01299711 0.01870931 0.03870024 0.0089204 0.0180908 0.05893076\n",
" 0.00110867 0.0374535 0.03500569 0.00381349 0.01974315 0.01109955\n",
" 0.0193386 0.01273648 0.00520618 0.00420536 0.02597861 0.01698477\n",
" 0.02535973 0.03901061 0.06862038 0.01811373 0.02478142 0.00293201\n",
" 0.06915429 0.01105668 0.01370129 0.03923714 0.02045223 0.00193326\n",
" 0.01717238 0.01441661 0.04590873 0.00871267]\n"
]
}
],
@@ -1669,15 +1669,15 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[ 1.94735263 0.70175778 2.99348646 1.86611894 -0.45576546]\n",
"[ 2.08019747 -1.5544062 12.12040799 -11.41377873 5.90871271]\n",
"Training R2\n",
"0.9959836634296064\n",
"0.9958244721767004\n",
"Training MSE\n",
"0.0085274606925055\n",
"0.010405448150048726\n",
"Test R2\n",
"0.992232777849821\n",
"0.9929666457835595\n",
"Test MSE\n",
"0.010638334964957053\n"
"0.018365206985554446\n"
]
}
],
@@ -2556,7 +2556,13 @@
" 4.14277718e-08 1.44624525e-08 2.37239927e-09 8.28205578e-10\n",
" 2.89126914e-10 1.00934327e-10 3.52362157e-11 1.65571174e-11\n",
" 5.78009660e-12 2.01783414e-12 7.04426744e-13 2.45915671e-13\n",
" 8.58492636e-14]\n",
" 8.58492636e-14]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Feature max values before scaling:\n",
" [1. 0.99970894 0.99978365 0.99941797 0.99949266 0.99956735\n",
" 0.99912709 0.99920175 0.99927642 0.9993511 0.99883628 0.99891093\n",
Binary file not shown.