log regression formula update
This commit is contained in:
@@ -13,6 +13,10 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"$$ w^T x = w_0 + w_1x_1 + w_2x_2 + w_3x_3 $$\n",
|
"$$ w^T x = w_0 + w_1x_1 + w_2x_2 + w_3x_3 $$\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
"$$ w^Tx = \\sum^n_{i=1}{w_i \\cdot x_i} $$\n",
|
||||||
|
"\n",
|
||||||
|
"$$ \\sigma = \\frac{1}{1 + e^{-w^T}} $$\n",
|
||||||
|
"\n",
|
||||||
"$$ P(y|x) = σ(w^Tx) $$\n",
|
"$$ P(y|x) = σ(w^Tx) $$\n",
|
||||||
"\n",
|
"\n",
|
||||||
"## Given data:\n",
|
"## Given data:\n",
|
||||||
@@ -133,7 +137,7 @@
|
|||||||
"plt.show()\n",
|
"plt.show()\n",
|
||||||
"\n",
|
"\n",
|
||||||
"plt.plot(x, np.log(fn(x)))\n",
|
"plt.plot(x, np.log(fn(x)))\n",
|
||||||
"plt.show()\n"
|
"plt.show()"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -213,7 +217,7 @@
|
|||||||
"labels = np.hstack((np.zeros(num_observations), np.ones(num_observations)))\n",
|
"labels = np.hstack((np.zeros(num_observations), np.ones(num_observations)))\n",
|
||||||
"plt.figure(figsize=(12, 8))\n",
|
"plt.figure(figsize=(12, 8))\n",
|
||||||
"plt.scatter(features[:,0], features[:,1], alpha=.4, c=labels)\n",
|
"plt.scatter(features[:,0], features[:,1], alpha=.4, c=labels)\n",
|
||||||
"plt.show()\n"
|
"plt.show()"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -375,8 +379,15 @@
|
|||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython3",
|
"pygments_lexer": "ipython3",
|
||||||
"version": "3.6.1"
|
"version": "3.6.1"
|
||||||
|
},
|
||||||
|
"latex_envs": {
|
||||||
|
"bibliofile": "biblio.bib",
|
||||||
|
"cite_by": "apalike",
|
||||||
|
"current_citInitial": 1,
|
||||||
|
"eqLabelWithNumbers": true,
|
||||||
|
"eqNumInitial": 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
"nbformat_minor": 2
|
"nbformat_minor": 1
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user