{"id":1155,"date":"2023-07-27T11:31:28","date_gmt":"2023-07-27T11:31:28","guid":{"rendered":"https:\/\/statorials.org\/th\/%e0%b8%ab%e0%b8%a5%e0%b8%b2%e0%b8%a1%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%96%e0%b8%94%e0%b8%96%e0%b8%ad%e0%b8%a2%e0%b9%82%e0%b8%a5%e0%b8%88%e0%b8%b4%e0%b8%aa%e0%b8%95%e0%b8%b4%e0%b8%81\/"},"modified":"2023-07-27T11:31:28","modified_gmt":"2023-07-27T11:31:28","slug":"%e0%b8%ab%e0%b8%a5%e0%b8%b2%e0%b8%a1%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%96%e0%b8%94%e0%b8%96%e0%b8%ad%e0%b8%a2%e0%b9%82%e0%b8%a5%e0%b8%88%e0%b8%b4%e0%b8%aa%e0%b8%95%e0%b8%b4%e0%b8%81","status":"publish","type":"post","link":"https:\/\/statorials.org\/th\/%e0%b8%ab%e0%b8%a5%e0%b8%b2%e0%b8%a1%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%96%e0%b8%94%e0%b8%96%e0%b8%ad%e0%b8%a2%e0%b9%82%e0%b8%a5%e0%b8%88%e0%b8%b4%e0%b8%aa%e0%b8%95%e0%b8%b4%e0%b8%81\/","title":{"rendered":"\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e42\u0e25\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01\u0e43\u0e19 python (\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19)"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\"><a href=\"https:\/\/statorials.org\/th\/\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e42\u0e25\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01-1\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e41\u0e1a\u0e1a\u0e25\u0e2d\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01<\/a> \u0e40\u0e1b\u0e47\u0e19\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e17\u0e35\u0e48\u0e40\u0e23\u0e32\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e43\u0e0a\u0e49\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e43\u0e2b\u0e49\u0e1e\u0e2d\u0e14\u0e35\u0e01\u0e31\u0e1a\u0e41\u0e1a\u0e1a\u0e08\u0e33\u0e25\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e40\u0e21\u0e37\u0e48\u0e2d <a href=\"https:\/\/statorials.org\/th\/\u0e15\u0e31\u0e27\u0e41\u0e1b\u0e23\u0e17\u0e35\u0e48\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e01\u0e32\u0e23\u0e15\u0e2d\u0e1a\u0e2a\u0e19\u0e2d\u0e07\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u0e15\u0e31\u0e27\u0e41\u0e1b\u0e23\u0e15\u0e2d\u0e1a\u0e2a\u0e19\u0e2d\u0e07<\/a> \u0e40\u0e1b\u0e47\u0e19\u0e44\u0e1a\u0e19\u0e32\u0e23\u0e35<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e42\u0e25\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01\u0e43\u0e0a\u0e49\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e17\u0e35\u0e48\u0e40\u0e23\u0e35\u0e22\u0e01\u0e27\u0e48\u0e32 <em>\u0e01\u0e32\u0e23\u0e1b\u0e23\u0e30\u0e21\u0e32\u0e13\u0e04\u0e48\u0e32\u0e04\u0e27\u0e32\u0e21\u0e19\u0e48\u0e32\u0e08\u0e30\u0e40\u0e1b\u0e47\u0e19\u0e2a\u0e39\u0e07\u0e2a\u0e38\u0e14<\/em> \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e04\u0e49\u0e19\u0e2b\u0e32\u0e2a\u0e21\u0e01\u0e32\u0e23\u0e43\u0e19\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a\u0e15\u0e48\u0e2d\u0e44\u0e1b\u0e19\u0e35\u0e49:<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01[p(X) \/ ( <sub>1<\/sub> -p(X))] = \u03b2 <sub>0<\/sub> + \u03b2 <sub>1<\/sub> X <sub>1<\/sub> + \u03b2 <sub>2<\/sub> X <sub>2<\/sub> + \u2026 + \u03b2 <sub>\u0e1e\u0e35<\/sub><\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e17\u0e2d\u0e07:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>X <sub>j<\/sub><\/strong> : <sup>\u0e15\u0e31\u0e27\u0e41\u0e1b\u0e23<\/sup> \u0e17\u0e33\u0e19\u0e32\u0e22\u0e17\u0e35\u0e48 j<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>\u03b2 <sub>j<\/sub><\/strong> : \u0e01\u0e32\u0e23\u0e1b\u0e23\u0e30\u0e21\u0e32\u0e13\u0e04\u0e48\u0e32\u0e2a\u0e31\u0e21\u0e1b\u0e23\u0e30\u0e2a\u0e34\u0e17\u0e18\u0e34\u0e4c\u0e02\u0e2d\u0e07\u0e15\u0e31\u0e27\u0e41\u0e1b\u0e23\u0e17\u0e33\u0e19\u0e32\u0e22\u0e17\u0e35\u0e48 <sup>j<\/sup><\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">\u0e2a\u0e39\u0e15\u0e23\u0e17\u0e32\u0e07\u0e14\u0e49\u0e32\u0e19\u0e02\u0e27\u0e32\u0e02\u0e2d\u0e07\u0e2a\u0e21\u0e01\u0e32\u0e23\u0e17\u0e33\u0e19\u0e32\u0e22 <strong>\u0e2d\u0e31\u0e15\u0e23\u0e32\u0e15\u0e48\u0e2d\u0e23\u0e2d\u0e07\u0e02\u0e2d\u0e07\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01<\/strong> \u0e17\u0e35\u0e48\u0e15\u0e31\u0e27\u0e41\u0e1b\u0e23\u0e15\u0e2d\u0e1a\u0e01\u0e25\u0e31\u0e1a\u0e23\u0e31\u0e1a\u0e04\u0e48\u0e32 1<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e14\u0e31\u0e07\u0e19\u0e31\u0e49\u0e19 \u0e40\u0e21\u0e37\u0e48\u0e2d\u0e40\u0e23\u0e32\u0e1b\u0e23\u0e31\u0e1a\u0e41\u0e1a\u0e1a\u0e08\u0e33\u0e25\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e25\u0e2d\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01\u0e43\u0e2b\u0e49\u0e40\u0e2b\u0e21\u0e32\u0e30\u0e2a\u0e21 \u0e40\u0e23\u0e32\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e43\u0e0a\u0e49\u0e2a\u0e21\u0e01\u0e32\u0e23\u0e15\u0e48\u0e2d\u0e44\u0e1b\u0e19\u0e35\u0e49\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e04\u0e33\u0e19\u0e27\u0e13\u0e04\u0e27\u0e32\u0e21\u0e19\u0e48\u0e32\u0e08\u0e30\u0e40\u0e1b\u0e47\u0e19\u0e17\u0e35\u0e48\u0e01\u0e32\u0e23\u0e2a\u0e31\u0e07\u0e40\u0e01\u0e15\u0e17\u0e35\u0e48\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e08\u0e30\u0e44\u0e14\u0e49\u0e04\u0e48\u0e32 1:<\/span><\/p>\n<p> <span style=\"color: #000000;\">p(X) = \u0e2d\u0e35 <sup>\u03b2 <sub>0<\/sub> + <sub>\u03b2<\/sub> <sub>1<\/sub> <sub>X<\/sub> <sub>1<\/sub> <sub>+<\/sub> <sub>\u03b2<\/sub><\/sup> <sup><sub>2<\/sub> <sub>X<\/sub> <sub>2<\/sub> <sub>+<\/sub> <sub>\u2026<\/sub> <sub>+<\/sub> <sub>\u03b2<\/sub><\/sup> p<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e40\u0e23\u0e32\u0e43\u0e0a\u0e49\u0e40\u0e01\u0e13\u0e11\u0e4c\u0e04\u0e27\u0e32\u0e21\u0e19\u0e48\u0e32\u0e08\u0e30\u0e40\u0e1b\u0e47\u0e19\u0e17\u0e35\u0e48\u0e41\u0e19\u0e48\u0e19\u0e2d\u0e19\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e08\u0e31\u0e14\u0e1b\u0e23\u0e30\u0e40\u0e20\u0e17\u0e01\u0e32\u0e23\u0e2a\u0e31\u0e07\u0e40\u0e01\u0e15\u0e40\u0e1b\u0e47\u0e19 1 \u0e2b\u0e23\u0e37\u0e2d 0<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e40\u0e0a\u0e48\u0e19 \u0e40\u0e23\u0e32\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e1e\u0e39\u0e14\u0e44\u0e14\u0e49\u0e27\u0e48\u0e32\u0e01\u0e32\u0e23\u0e2a\u0e31\u0e07\u0e40\u0e01\u0e15\u0e17\u0e35\u0e48\u0e21\u0e35\u0e04\u0e27\u0e32\u0e21\u0e19\u0e48\u0e32\u0e08\u0e30\u0e40\u0e1b\u0e47\u0e19\u0e21\u0e32\u0e01\u0e01\u0e27\u0e48\u0e32\u0e2b\u0e23\u0e37\u0e2d\u0e40\u0e17\u0e48\u0e32\u0e01\u0e31\u0e1a 0.5 \u0e08\u0e30\u0e16\u0e39\u0e01\u0e08\u0e31\u0e14\u0e1b\u0e23\u0e30\u0e40\u0e20\u0e17\u0e40\u0e1b\u0e47\u0e19 &#8220;1&#8221; \u0e41\u0e25\u0e30\u0e01\u0e32\u0e23\u0e2a\u0e31\u0e07\u0e40\u0e01\u0e15\u0e2d\u0e37\u0e48\u0e19\u0e46 \u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14\u0e08\u0e30\u0e16\u0e39\u0e01\u0e08\u0e31\u0e14\u0e1b\u0e23\u0e30\u0e40\u0e20\u0e17\u0e40\u0e1b\u0e47\u0e19 &#8220;0&#8221;<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e43\u0e2b\u0e49\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e02\u0e2d\u0e07\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e42\u0e25\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01\u0e43\u0e19 R<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e17\u0e35\u0e48 1: \u0e19\u0e33\u0e40\u0e02\u0e49\u0e32\u0e41\u0e1e\u0e47\u0e04\u0e40\u0e01\u0e08\u0e17\u0e35\u0e48\u0e08\u0e33\u0e40\u0e1b\u0e47\u0e19<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">\u0e02\u0e31\u0e49\u0e19\u0e41\u0e23\u0e01 \u0e40\u0e23\u0e32\u0e08\u0e30\u0e19\u0e33\u0e40\u0e02\u0e49\u0e32\u0e41\u0e1e\u0e47\u0e04\u0e40\u0e01\u0e08\u0e17\u0e35\u0e48\u0e08\u0e33\u0e40\u0e1b\u0e47\u0e19\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e17\u0e33\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e42\u0e25\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01\u0e43\u0e19 Python:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">import<\/span> pandas <span style=\"color: #008000;\">as<\/span> pd\n<span style=\"color: #008000;\">import<\/span> numpy <span style=\"color: #008000;\">as<\/span> np\n<span style=\"color: #008000;\">from<\/span> sklearn. <span style=\"color: #3366ff;\">model_selection<\/span> <span style=\"color: #008000;\">import<\/span> train_test_split\n<span style=\"color: #008000;\">from<\/span> sklearn. <span style=\"color: #3366ff;\">linear_model<\/span> <span style=\"color: #008000;\">import<\/span> LogisticRegression\n<span style=\"color: #008000;\">from<\/span> sklearn <span style=\"color: #008000;\">import<\/span> metrics\n<span style=\"color: #008000;\">import<\/span> matplotlib. <span style=\"color: #3366ff;\">pyplot<\/span> <span style=\"color: #008000;\">as<\/span> plt\n<\/strong><\/pre>\n<h3> <span style=\"color: #000000;\"><strong>\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e17\u0e35\u0e48 2: \u0e42\u0e2b\u0e25\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e19\u0e35\u0e49 \u0e40\u0e23\u0e32\u0e08\u0e30\u0e43\u0e0a\u0e49\u0e0a\u0e38\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 <strong>\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19<\/strong> \u0e08\u0e32\u0e01 <a href=\"https:\/\/www.ime.unicamp.br\/~dias\/Intoduction%20to%20Statistical%20Learning.pdf\" target=\"_blank\" rel=\"noopener noreferrer\">\u0e2b\u0e19\u0e31\u0e07\u0e2a\u0e37\u0e2d Introduction to Statistical Learning<\/a> \u0e40\u0e23\u0e32\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e43\u0e0a\u0e49\u0e42\u0e04\u0e49\u0e14\u0e15\u0e48\u0e2d\u0e44\u0e1b\u0e19\u0e35\u0e49\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e42\u0e2b\u0e25\u0e14\u0e41\u0e25\u0e30\u0e41\u0e2a\u0e14\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e2a\u0e23\u0e38\u0e1b\u0e02\u0e2d\u0e07\u0e0a\u0e38\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#import dataset from CSV file on Github\n<span style=\"color: #000000;\">url = \"https:\/\/raw.githubusercontent.com\/Statorials\/Python-Guides\/main\/default.csv\"\ndata = pd. <span style=\"color: #3366ff;\">read_csv<\/span> (url)\n<\/span><\/span>\n<span style=\"color: #008080;\">#view first six rows of dataset\n<\/span>data[0:6]\n\n        default student balance income\n0 0 0 729.526495 44361.625074\n1 0 1 817.180407 12106.134700\n2 0 0 1073.549164 31767.138947\n3 0 0 529.250605 35704.493935\n4 0 0 785.655883 38463.495879\n5 0 1 919.588530 7491.558572  \n\n<span style=\"color: #008080;\">#find total observations in dataset<\/span>\nlen( <span style=\"color: #3366ff;\">data.index<\/span> )\n\n10000\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">\u0e0a\u0e38\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e19\u0e35\u0e49\u0e21\u0e35\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e15\u0e48\u0e2d\u0e44\u0e1b\u0e19\u0e35\u0e49\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e1a\u0e38\u0e04\u0e04\u0e25 10,000 \u0e04\u0e19:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>\u0e04\u0e48\u0e32\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19:<\/strong> \u0e23\u0e30\u0e1a\u0e38\u0e27\u0e48\u0e32\u0e1a\u0e38\u0e04\u0e04\u0e25\u0e19\u0e31\u0e49\u0e19\u0e1c\u0e34\u0e14\u0e19\u0e31\u0e14\u0e2b\u0e23\u0e37\u0e2d\u0e44\u0e21\u0e48<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>\u0e19\u0e31\u0e01\u0e40\u0e23\u0e35\u0e22\u0e19:<\/strong> \u0e23\u0e30\u0e1a\u0e38\u0e27\u0e48\u0e32\u0e1a\u0e38\u0e04\u0e04\u0e25\u0e19\u0e31\u0e49\u0e19\u0e40\u0e1b\u0e47\u0e19\u0e19\u0e31\u0e01\u0e40\u0e23\u0e35\u0e22\u0e19\u0e2b\u0e23\u0e37\u0e2d\u0e44\u0e21\u0e48<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>\u0e22\u0e2d\u0e14\u0e04\u0e07\u0e40\u0e2b\u0e25\u0e37\u0e2d:<\/strong> \u0e22\u0e2d\u0e14\u0e04\u0e07\u0e40\u0e2b\u0e25\u0e37\u0e2d\u0e40\u0e09\u0e25\u0e35\u0e48\u0e22\u0e17\u0e35\u0e48\u0e16\u0e37\u0e2d\u0e42\u0e14\u0e22\u0e1a\u0e38\u0e04\u0e04\u0e25<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>\u0e23\u0e32\u0e22\u0e44\u0e14\u0e49:<\/strong> \u0e23\u0e32\u0e22\u0e44\u0e14\u0e49\u0e02\u0e2d\u0e07\u0e41\u0e15\u0e48\u0e25\u0e30\u0e1a\u0e38\u0e04\u0e04\u0e25<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">\u0e40\u0e23\u0e32\u0e08\u0e30\u0e43\u0e0a\u0e49\u0e2a\u0e16\u0e32\u0e19\u0e30\u0e19\u0e31\u0e01\u0e28\u0e36\u0e01\u0e29\u0e32 \u0e22\u0e2d\u0e14\u0e04\u0e07\u0e40\u0e2b\u0e25\u0e37\u0e2d\u0e43\u0e19\u0e18\u0e19\u0e32\u0e04\u0e32\u0e23 \u0e41\u0e25\u0e30\u0e23\u0e32\u0e22\u0e44\u0e14\u0e49\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e41\u0e1a\u0e1a\u0e08\u0e33\u0e25\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e25\u0e2d\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01\u0e17\u0e35\u0e48\u0e04\u0e32\u0e14\u0e01\u0e32\u0e23\u0e13\u0e4c\u0e04\u0e27\u0e32\u0e21\u0e19\u0e48\u0e32\u0e08\u0e30\u0e40\u0e1b\u0e47\u0e19\u0e17\u0e35\u0e48\u0e1a\u0e38\u0e04\u0e04\u0e25\u0e2b\u0e19\u0e36\u0e48\u0e07\u0e46 \u0e08\u0e30\u0e1c\u0e34\u0e14\u0e19\u0e31\u0e14\u0e0a\u0e33\u0e23\u0e30\u0e2b\u0e19\u0e35\u0e49<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e17\u0e35\u0e48 3: \u0e2a\u0e23\u0e49\u0e32\u0e07\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e01\u0e32\u0e23\u0e1d\u0e36\u0e01\u0e2d\u0e1a\u0e23\u0e21\u0e41\u0e25\u0e30\u0e01\u0e32\u0e23\u0e17\u0e14\u0e2a\u0e2d\u0e1a<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">\u0e15\u0e48\u0e2d\u0e44\u0e1b \u0e40\u0e23\u0e32\u0e08\u0e30\u0e41\u0e1a\u0e48\u0e07\u0e0a\u0e38\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e2d\u0e2d\u0e01\u0e40\u0e1b\u0e47\u0e19\u0e0a\u0e38\u0e14\u0e01\u0e32\u0e23\u0e1d\u0e36\u0e01\u0e40\u0e1e\u0e37\u0e48\u0e2d <em>\u0e1d\u0e36\u0e01<\/em> \u0e42\u0e21\u0e40\u0e14\u0e25\u0e41\u0e25\u0e30\u0e0a\u0e38\u0e14\u0e17\u0e14\u0e2a\u0e2d\u0e1a <em>\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e17\u0e14\u0e2a\u0e2d\u0e1a<\/em> \u0e42\u0e21\u0e40\u0e14\u0e25<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#define the predictor variables and the response variable\n<\/span>X = data[[' <span style=\"color: #008000;\">student<\/span> ',' <span style=\"color: #008000;\">balance<\/span> ',' <span style=\"color: #008000;\">income<\/span> ']]\ny = data[' <span style=\"color: #008000;\">default<\/span> ']\n\n<span style=\"color: #008080;\">#split the dataset into training (70%) and testing (30%) sets\n<\/span>X_train,X_test,y_train,y_test = <span style=\"color: #3366ff;\">train_test_split<\/span> (X,y,test_size=0.3,random_state=0)<\/strong><\/pre>\n<h3> <span style=\"color: #000000;\"><strong>\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e17\u0e35\u0e48 4: \u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07\u0e41\u0e1a\u0e1a\u0e08\u0e33\u0e25\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e42\u0e25\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">\u0e15\u0e48\u0e2d\u0e44\u0e1b \u0e40\u0e23\u0e32\u0e08\u0e30\u0e43\u0e0a\u0e49\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19 <b>LogisticRegression()<\/b> \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e43\u0e2b\u0e49\u0e1e\u0e2d\u0e14\u0e35\u0e01\u0e31\u0e1a\u0e41\u0e1a\u0e1a\u0e08\u0e33\u0e25\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e42\u0e25\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01\u0e01\u0e31\u0e1a\u0e0a\u0e38\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#instantiate the model\n<\/span>log_regression = LogisticRegression()\n\n<span style=\"color: #008080;\">#fit the model using the training data\n<\/span>log_regression. <span style=\"color: #3366ff;\">fit<\/span> (X_train,y_train)\n\n<span style=\"color: #008080;\">#use model to make predictions on test data\n<\/span>y_pred = log_regression. <span style=\"color: #3366ff;\">predict<\/span> (X_test)\n<\/strong><\/pre>\n<h3> <span style=\"color: #000000;\"><strong>\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e17\u0e35\u0e48 5: \u0e01\u0e32\u0e23\u0e27\u0e34\u0e19\u0e34\u0e08\u0e09\u0e31\u0e22\u0e42\u0e21\u0e40\u0e14\u0e25<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e40\u0e23\u0e32\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07\u0e41\u0e1a\u0e1a\u0e08\u0e33\u0e25\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e41\u0e25\u0e49\u0e27 \u0e40\u0e23\u0e32\u0e01\u0e47\u0e08\u0e30\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e27\u0e34\u0e40\u0e04\u0e23\u0e32\u0e30\u0e2b\u0e4c\u0e1b\u0e23\u0e30\u0e2a\u0e34\u0e17\u0e18\u0e34\u0e20\u0e32\u0e1e\u0e02\u0e2d\u0e07\u0e41\u0e1a\u0e1a\u0e08\u0e33\u0e25\u0e2d\u0e07\u0e02\u0e2d\u0e07\u0e40\u0e23\u0e32\u0e1a\u0e19\u0e0a\u0e38\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e14\u0e2a\u0e2d\u0e1a\u0e44\u0e14\u0e49<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e02\u0e31\u0e49\u0e19\u0e41\u0e23\u0e01 \u0e40\u0e23\u0e32\u0e08\u0e30\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e40\u0e21\u0e17\u0e23\u0e34\u0e01\u0e0b\u0e4c\u0e04\u0e27\u0e32\u0e21\u0e2a\u0e31\u0e1a\u0e2a\u0e19<\/span> <span style=\"color: #000000;\">\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e42\u0e21\u0e40\u0e14\u0e25:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong>cnf_matrix = metrics. <span style=\"color: #3366ff;\">confusion_matrix<\/span> (y_test, y_pred)\ncnf_matrix\n\narray([[2886, 1],\n       [113,0]])\n<\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\">\u0e08\u0e32\u0e01\u0e40\u0e21\u0e17\u0e23\u0e34\u0e01\u0e0b\u0e4c\u0e04\u0e27\u0e32\u0e21\u0e2a\u0e31\u0e1a\u0e2a\u0e19\u0e40\u0e23\u0e32\u0e08\u0e30\u0e40\u0e2b\u0e47\u0e19\u0e44\u0e14\u0e49\u0e27\u0e48\u0e32:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\">#\u0e04\u0e33\u0e17\u0e33\u0e19\u0e32\u0e22\u0e40\u0e0a\u0e34\u0e07\u0e1a\u0e27\u0e01\u0e17\u0e35\u0e48\u0e41\u0e17\u0e49\u0e08\u0e23\u0e34\u0e07: 2886<\/span><\/li>\n<li> <span style=\"color: #000000;\">#\u0e04\u0e33\u0e17\u0e33\u0e19\u0e32\u0e22\u0e40\u0e0a\u0e34\u0e07\u0e25\u0e1a\u0e17\u0e35\u0e48\u0e41\u0e17\u0e49\u0e08\u0e23\u0e34\u0e07: 0<\/span><\/li>\n<li> <span style=\"color: #000000;\">#\u0e04\u0e33\u0e17\u0e33\u0e19\u0e32\u0e22\u0e1c\u0e25\u0e1a\u0e27\u0e01\u0e25\u0e27\u0e07 : 113<\/span><\/li>\n<li> <span style=\"color: #000000;\">#\u0e01\u0e32\u0e23\u0e17\u0e33\u0e19\u0e32\u0e22\u0e40\u0e0a\u0e34\u0e07\u0e25\u0e1a\u0e17\u0e35\u0e48\u0e40\u0e1b\u0e47\u0e19\u0e40\u0e17\u0e47\u0e08: 1<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">\u0e19\u0e2d\u0e01\u0e08\u0e32\u0e01\u0e19\u0e35\u0e49\u0e40\u0e23\u0e32\u0e22\u0e31\u0e07\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e23\u0e31\u0e1a\u0e41\u0e1a\u0e1a\u0e08\u0e33\u0e25\u0e2d\u0e07\u0e04\u0e27\u0e32\u0e21\u0e41\u0e21\u0e48\u0e19\u0e22\u0e33 \u0e0b\u0e36\u0e48\u0e07\u0e1a\u0e2d\u0e01\u0e40\u0e1b\u0e2d\u0e23\u0e4c\u0e40\u0e0b\u0e47\u0e19\u0e15\u0e4c\u0e02\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e04\u0e32\u0e14\u0e01\u0e32\u0e23\u0e13\u0e4c\u0e01\u0e32\u0e23\u0e41\u0e01\u0e49\u0e44\u0e02\u0e17\u0e35\u0e48\u0e17\u0e33\u0e42\u0e14\u0e22\u0e41\u0e1a\u0e1a\u0e08\u0e33\u0e25\u0e2d\u0e07:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>print(\" <span style=\"color: #008000;\">Accuracy:<\/span> \", <span style=\"color: #3366ff;\">metrics.accuracy_score<\/span> (y_test, y_pred))l\n\nAccuracy: 0.962\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e19\u0e35\u0e49\u0e1a\u0e2d\u0e01\u0e40\u0e23\u0e32\u0e27\u0e48\u0e32\u0e42\u0e21\u0e40\u0e14\u0e25\u0e04\u0e32\u0e14\u0e01\u0e32\u0e23\u0e13\u0e4c\u0e44\u0e14\u0e49\u0e16\u0e39\u0e01\u0e15\u0e49\u0e2d\u0e07\u0e27\u0e48\u0e32\u0e1a\u0e38\u0e04\u0e04\u0e25\u0e19\u0e31\u0e49\u0e19\u0e08\u0e30\u0e1c\u0e34\u0e14\u0e19\u0e31\u0e14 <strong>96.2%<\/strong> \u0e02\u0e2d\u0e07\u0e40\u0e27\u0e25\u0e32\u0e2b\u0e23\u0e37\u0e2d\u0e44\u0e21\u0e48<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e2a\u0e38\u0e14\u0e17\u0e49\u0e32\u0e22\u0e19\u0e35\u0e49 \u0e40\u0e23\u0e32\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e1e\u0e25\u0e47\u0e2d\u0e15\u0e40\u0e2a\u0e49\u0e19\u0e42\u0e04\u0e49\u0e07\u0e25\u0e31\u0e01\u0e29\u0e13\u0e30\u0e01\u0e32\u0e23\u0e17\u0e33\u0e07\u0e32\u0e19\u0e02\u0e2d\u0e07\u0e15\u0e31\u0e27\u0e23\u0e31\u0e1a (ROC) \u0e0b\u0e36\u0e48\u0e07\u0e41\u0e2a\u0e14\u0e07\u0e40\u0e1b\u0e2d\u0e23\u0e4c\u0e40\u0e0b\u0e47\u0e19\u0e15\u0e4c\u0e02\u0e2d\u0e07\u0e1c\u0e25\u0e1a\u0e27\u0e01\u0e08\u0e23\u0e34\u0e07\u0e17\u0e35\u0e48\u0e17\u0e33\u0e19\u0e32\u0e22\u0e42\u0e14\u0e22\u0e41\u0e1a\u0e1a\u0e08\u0e33\u0e25\u0e2d\u0e07 \u0e40\u0e21\u0e37\u0e48\u0e2d\u0e40\u0e01\u0e13\u0e11\u0e4c\u0e04\u0e27\u0e32\u0e21\u0e19\u0e48\u0e32\u0e08\u0e30\u0e40\u0e1b\u0e47\u0e19\u0e43\u0e19\u0e01\u0e32\u0e23\u0e17\u0e33\u0e19\u0e32\u0e22\u0e25\u0e14\u0e25\u0e07\u0e08\u0e32\u0e01 1 \u0e40\u0e1b\u0e47\u0e19 0<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e22\u0e34\u0e48\u0e07 AUC \u0e2a\u0e39\u0e07 (\u0e1e\u0e37\u0e49\u0e19\u0e17\u0e35\u0e48\u0e43\u0e15\u0e49\u0e40\u0e2a\u0e49\u0e19\u0e42\u0e04\u0e49\u0e07) \u0e41\u0e1a\u0e1a\u0e08\u0e33\u0e25\u0e2d\u0e07\u0e02\u0e2d\u0e07\u0e40\u0e23\u0e32\u0e01\u0e47\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e17\u0e33\u0e19\u0e32\u0e22\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e44\u0e14\u0e49\u0e41\u0e21\u0e48\u0e19\u0e22\u0e33\u0e22\u0e34\u0e48\u0e07\u0e02\u0e36\u0e49\u0e19:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008080;\">#define metrics<\/span>\ny_pred_proba = log_regression. <span style=\"color: #3366ff;\">predict_proba<\/span> (X_test)[::,1]\nfpr, tpr, _ = metrics. <span style=\"color: #3366ff;\">roc_curve<\/span> (y_test, y_pred_proba)\nauc = metrics. <span style=\"color: #3366ff;\">roc_auc_score<\/span> (y_test, y_pred_proba)\n\n<span style=\"color: #008080;\">#create ROC curve\n<\/span>plt. <span style=\"color: #3366ff;\">plot<\/span> (fpr,tpr,label=\" <span style=\"color: #008000;\">AUC=<\/span> \"+str(auc))\nplt. <span style=\"color: #3366ff;\">legend<\/span> (loc=4)\nplt. <span style=\"color: #3366ff;\">show<\/span> ()\n<\/strong><\/span><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-11591 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/auc1.png\" alt=\"\u0e40\u0e2a\u0e49\u0e19\u0e42\u0e04\u0e49\u0e07 ROC \u0e43\u0e19 Python\" width=\"389\" height=\"262\" srcset=\"\" sizes=\"auto, \"><\/p>\n<div class=\"entry-content entry-content-single\" data-content-ads-inserted=\"true\">\n<p> <em><span style=\"color: #000000;\">\u0e23\u0e2b\u0e31\u0e2a Python \u0e41\u0e1a\u0e1a\u0e40\u0e15\u0e47\u0e21\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e43\u0e19\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e1e\u0e1a\u0e44\u0e14\u0e49 <a href=\"https:\/\/github.com\/Statorials\/Python-Guides\/blob\/main\/logistic_regression.py\" target=\"_blank\" rel=\"noopener noreferrer\">\u0e17\u0e35\u0e48\u0e19\u0e35\u0e48<\/a><\/span><\/em><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e41\u0e1a\u0e1a\u0e25\u0e2d\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01 \u0e40\u0e1b\u0e47\u0e19\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e17\u0e35\u0e48\u0e40\u0e23\u0e32\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e43\u0e0a\u0e49\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e43\u0e2b\u0e49\u0e1e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1155","post","type-post","status-publish","format-standard","hentry","category-3"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u0e27\u0e34\u0e18\u0e35\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23 Logistic Regression \u0e43\u0e19 Python (\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19) - Statology<\/title>\n<meta name=\"description\" content=\"\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e08\u0e30\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e42\u0e25\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01\u0e43\u0e19 Python \u0e23\u0e27\u0e21\u0e16\u0e36\u0e07\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/th\/\u0e2b\u0e25\u0e32\u0e21\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e42\u0e25\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01\/\" \/>\n<meta property=\"og:locale\" content=\"th_TH\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u0e27\u0e34\u0e18\u0e35\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23 Logistic Regression \u0e43\u0e19 Python (\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19) - Statology\" \/>\n<meta property=\"og:description\" content=\"\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e08\u0e30\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e42\u0e25\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01\u0e43\u0e19 Python \u0e23\u0e27\u0e21\u0e16\u0e36\u0e07\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/th\/\u0e2b\u0e25\u0e32\u0e21\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e42\u0e25\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-27T11:31:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/auc1.png\" \/>\n<meta name=\"author\" content=\"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u0e19\u0e32\u0e17\u0e35\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/th\/%e0%b8%ab%e0%b8%a5%e0%b8%b2%e0%b8%a1%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%96%e0%b8%94%e0%b8%96%e0%b8%ad%e0%b8%a2%e0%b9%82%e0%b8%a5%e0%b8%88%e0%b8%b4%e0%b8%aa%e0%b8%95%e0%b8%b4%e0%b8%81\/\",\"url\":\"https:\/\/statorials.org\/th\/%e0%b8%ab%e0%b8%a5%e0%b8%b2%e0%b8%a1%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%96%e0%b8%94%e0%b8%96%e0%b8%ad%e0%b8%a2%e0%b9%82%e0%b8%a5%e0%b8%88%e0%b8%b4%e0%b8%aa%e0%b8%95%e0%b8%b4%e0%b8%81\/\",\"name\":\"\u0e27\u0e34\u0e18\u0e35\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23 Logistic Regression \u0e43\u0e19 Python (\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19) - Statology\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/th\/#website\"},\"datePublished\":\"2023-07-27T11:31:28+00:00\",\"dateModified\":\"2023-07-27T11:31:28+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/th\/#\/schema\/person\/7c9bb3d0f799d0f1b17883495e1de332\"},\"description\":\"\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e08\u0e30\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e42\u0e25\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01\u0e43\u0e19 Python \u0e23\u0e27\u0e21\u0e16\u0e36\u0e07\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/th\/%e0%b8%ab%e0%b8%a5%e0%b8%b2%e0%b8%a1%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%96%e0%b8%94%e0%b8%96%e0%b8%ad%e0%b8%a2%e0%b9%82%e0%b8%a5%e0%b8%88%e0%b8%b4%e0%b8%aa%e0%b8%95%e0%b8%b4%e0%b8%81\/#breadcrumb\"},\"inLanguage\":\"th\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/th\/%e0%b8%ab%e0%b8%a5%e0%b8%b2%e0%b8%a1%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%96%e0%b8%94%e0%b8%96%e0%b8%ad%e0%b8%a2%e0%b9%82%e0%b8%a5%e0%b8%88%e0%b8%b4%e0%b8%aa%e0%b8%95%e0%b8%b4%e0%b8%81\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/th\/%e0%b8%ab%e0%b8%a5%e0%b8%b2%e0%b8%a1%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%96%e0%b8%94%e0%b8%96%e0%b8%ad%e0%b8%a2%e0%b9%82%e0%b8%a5%e0%b8%88%e0%b8%b4%e0%b8%aa%e0%b8%95%e0%b8%b4%e0%b8%81\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u0e1a\u0e49\u0e32\u0e19\",\"item\":\"https:\/\/statorials.org\/th\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e42\u0e25\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01\u0e43\u0e19 python (\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/th\/#website\",\"url\":\"https:\/\/statorials.org\/th\/\",\"name\":\"Statorials\",\"description\":\"\u0e04\u0e33\u0e41\u0e19\u0e30\u0e19\u0e33\u0e02\u0e2d\u0e07\u0e04\u0e38\u0e13\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e04\u0e27\u0e32\u0e21\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e17\u0e32\u0e07\u0e2a\u0e16\u0e34\u0e15\u0e34!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/th\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"th\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/th\/#\/schema\/person\/7c9bb3d0f799d0f1b17883495e1de332\",\"name\":\"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"th\",\"@id\":\"https:\/\/statorials.org\/th\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/th\/wp-content\/uploads\/2023\/11\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/th\/wp-content\/uploads\/2023\/11\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19\"},\"description\":\"\u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e35 \u0e09\u0e31\u0e19\u0e0a\u0e37\u0e48\u0e2d\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e28\u0e32\u0e2a\u0e15\u0e23\u0e32\u0e08\u0e32\u0e23\u0e22\u0e4c\u0e2a\u0e16\u0e34\u0e15\u0e34\u0e40\u0e01\u0e29\u0e35\u0e22\u0e13\u0e2d\u0e32\u0e22\u0e38\u0e41\u0e25\u0e49\u0e27 \u0e41\u0e25\u0e30\u0e1c\u0e31\u0e19\u0e15\u0e31\u0e27\u0e21\u0e32\u0e40\u0e1b\u0e47\u0e19\u0e04\u0e23\u0e39\u0e2a\u0e2d\u0e19\u0e2a\u0e16\u0e34\u0e15\u0e34\u0e42\u0e14\u0e22\u0e40\u0e09\u0e1e\u0e32\u0e30 \u0e14\u0e49\u0e27\u0e22\u0e1b\u0e23\u0e30\u0e2a\u0e1a\u0e01\u0e32\u0e23\u0e13\u0e4c\u0e41\u0e25\u0e30\u0e04\u0e27\u0e32\u0e21\u0e40\u0e0a\u0e35\u0e48\u0e22\u0e27\u0e0a\u0e32\u0e0d\u0e17\u0e35\u0e48\u0e01\u0e27\u0e49\u0e32\u0e07\u0e02\u0e27\u0e32\u0e07\u0e43\u0e19\u0e2a\u0e32\u0e02\u0e32\u0e2a\u0e16\u0e34\u0e15\u0e34 \u0e09\u0e31\u0e19\u0e01\u0e23\u0e30\u0e15\u0e37\u0e2d\u0e23\u0e37\u0e2d\u0e23\u0e49\u0e19\u0e17\u0e35\u0e48\u0e08\u0e30\u0e41\u0e1a\u0e48\u0e07\u0e1b\u0e31\u0e19\u0e04\u0e27\u0e32\u0e21\u0e23\u0e39\u0e49\u0e02\u0e2d\u0e07\u0e09\u0e31\u0e19\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e40\u0e2a\u0e23\u0e34\u0e21\u0e28\u0e31\u0e01\u0e22\u0e20\u0e32\u0e1e\u0e19\u0e31\u0e01\u0e40\u0e23\u0e35\u0e22\u0e19\u0e1c\u0e48\u0e32\u0e19 Statorials. \u0e23\u0e39\u0e49\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21\",\"sameAs\":[\"https:\/\/statorials.org\/th\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u0e27\u0e34\u0e18\u0e35\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23 Logistic Regression \u0e43\u0e19 Python (\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19) - Statology","description":"\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e08\u0e30\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e42\u0e25\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01\u0e43\u0e19 Python \u0e23\u0e27\u0e21\u0e16\u0e36\u0e07\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/statorials.org\/th\/\u0e2b\u0e25\u0e32\u0e21\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e42\u0e25\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01\/","og_locale":"th_TH","og_type":"article","og_title":"\u0e27\u0e34\u0e18\u0e35\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23 Logistic Regression \u0e43\u0e19 Python (\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19) - Statology","og_description":"\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e08\u0e30\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e42\u0e25\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01\u0e43\u0e19 Python \u0e23\u0e27\u0e21\u0e16\u0e36\u0e07\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19","og_url":"https:\/\/statorials.org\/th\/\u0e2b\u0e25\u0e32\u0e21\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e42\u0e25\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01\/","og_site_name":"Statorials","article_published_time":"2023-07-27T11:31:28+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/auc1.png"}],"author":"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19","twitter_card":"summary_large_image","twitter_misc":{"Written by":"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19","Est. reading time":"1 \u0e19\u0e32\u0e17\u0e35"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/th\/%e0%b8%ab%e0%b8%a5%e0%b8%b2%e0%b8%a1%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%96%e0%b8%94%e0%b8%96%e0%b8%ad%e0%b8%a2%e0%b9%82%e0%b8%a5%e0%b8%88%e0%b8%b4%e0%b8%aa%e0%b8%95%e0%b8%b4%e0%b8%81\/","url":"https:\/\/statorials.org\/th\/%e0%b8%ab%e0%b8%a5%e0%b8%b2%e0%b8%a1%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%96%e0%b8%94%e0%b8%96%e0%b8%ad%e0%b8%a2%e0%b9%82%e0%b8%a5%e0%b8%88%e0%b8%b4%e0%b8%aa%e0%b8%95%e0%b8%b4%e0%b8%81\/","name":"\u0e27\u0e34\u0e18\u0e35\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23 Logistic Regression \u0e43\u0e19 Python (\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19) - Statology","isPartOf":{"@id":"https:\/\/statorials.org\/th\/#website"},"datePublished":"2023-07-27T11:31:28+00:00","dateModified":"2023-07-27T11:31:28+00:00","author":{"@id":"https:\/\/statorials.org\/th\/#\/schema\/person\/7c9bb3d0f799d0f1b17883495e1de332"},"description":"\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e08\u0e30\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e42\u0e25\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01\u0e43\u0e19 Python \u0e23\u0e27\u0e21\u0e16\u0e36\u0e07\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19","breadcrumb":{"@id":"https:\/\/statorials.org\/th\/%e0%b8%ab%e0%b8%a5%e0%b8%b2%e0%b8%a1%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%96%e0%b8%94%e0%b8%96%e0%b8%ad%e0%b8%a2%e0%b9%82%e0%b8%a5%e0%b8%88%e0%b8%b4%e0%b8%aa%e0%b8%95%e0%b8%b4%e0%b8%81\/#breadcrumb"},"inLanguage":"th","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/th\/%e0%b8%ab%e0%b8%a5%e0%b8%b2%e0%b8%a1%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%96%e0%b8%94%e0%b8%96%e0%b8%ad%e0%b8%a2%e0%b9%82%e0%b8%a5%e0%b8%88%e0%b8%b4%e0%b8%aa%e0%b8%95%e0%b8%b4%e0%b8%81\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/th\/%e0%b8%ab%e0%b8%a5%e0%b8%b2%e0%b8%a1%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%96%e0%b8%94%e0%b8%96%e0%b8%ad%e0%b8%a2%e0%b9%82%e0%b8%a5%e0%b8%88%e0%b8%b4%e0%b8%aa%e0%b8%95%e0%b8%b4%e0%b8%81\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0e1a\u0e49\u0e32\u0e19","item":"https:\/\/statorials.org\/th\/"},{"@type":"ListItem","position":2,"name":"\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e42\u0e25\u0e08\u0e34\u0e2a\u0e15\u0e34\u0e01\u0e43\u0e19 python (\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19)"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/th\/#website","url":"https:\/\/statorials.org\/th\/","name":"Statorials","description":"\u0e04\u0e33\u0e41\u0e19\u0e30\u0e19\u0e33\u0e02\u0e2d\u0e07\u0e04\u0e38\u0e13\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e04\u0e27\u0e32\u0e21\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e17\u0e32\u0e07\u0e2a\u0e16\u0e34\u0e15\u0e34!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/th\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"th"},{"@type":"Person","@id":"https:\/\/statorials.org\/th\/#\/schema\/person\/7c9bb3d0f799d0f1b17883495e1de332","name":"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19","image":{"@type":"ImageObject","inLanguage":"th","@id":"https:\/\/statorials.org\/th\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/th\/wp-content\/uploads\/2023\/11\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/th\/wp-content\/uploads\/2023\/11\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19"},"description":"\u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e35 \u0e09\u0e31\u0e19\u0e0a\u0e37\u0e48\u0e2d\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e28\u0e32\u0e2a\u0e15\u0e23\u0e32\u0e08\u0e32\u0e23\u0e22\u0e4c\u0e2a\u0e16\u0e34\u0e15\u0e34\u0e40\u0e01\u0e29\u0e35\u0e22\u0e13\u0e2d\u0e32\u0e22\u0e38\u0e41\u0e25\u0e49\u0e27 \u0e41\u0e25\u0e30\u0e1c\u0e31\u0e19\u0e15\u0e31\u0e27\u0e21\u0e32\u0e40\u0e1b\u0e47\u0e19\u0e04\u0e23\u0e39\u0e2a\u0e2d\u0e19\u0e2a\u0e16\u0e34\u0e15\u0e34\u0e42\u0e14\u0e22\u0e40\u0e09\u0e1e\u0e32\u0e30 \u0e14\u0e49\u0e27\u0e22\u0e1b\u0e23\u0e30\u0e2a\u0e1a\u0e01\u0e32\u0e23\u0e13\u0e4c\u0e41\u0e25\u0e30\u0e04\u0e27\u0e32\u0e21\u0e40\u0e0a\u0e35\u0e48\u0e22\u0e27\u0e0a\u0e32\u0e0d\u0e17\u0e35\u0e48\u0e01\u0e27\u0e49\u0e32\u0e07\u0e02\u0e27\u0e32\u0e07\u0e43\u0e19\u0e2a\u0e32\u0e02\u0e32\u0e2a\u0e16\u0e34\u0e15\u0e34 \u0e09\u0e31\u0e19\u0e01\u0e23\u0e30\u0e15\u0e37\u0e2d\u0e23\u0e37\u0e2d\u0e23\u0e49\u0e19\u0e17\u0e35\u0e48\u0e08\u0e30\u0e41\u0e1a\u0e48\u0e07\u0e1b\u0e31\u0e19\u0e04\u0e27\u0e32\u0e21\u0e23\u0e39\u0e49\u0e02\u0e2d\u0e07\u0e09\u0e31\u0e19\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e40\u0e2a\u0e23\u0e34\u0e21\u0e28\u0e31\u0e01\u0e22\u0e20\u0e32\u0e1e\u0e19\u0e31\u0e01\u0e40\u0e23\u0e35\u0e22\u0e19\u0e1c\u0e48\u0e32\u0e19 Statorials. \u0e23\u0e39\u0e49\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21","sameAs":["https:\/\/statorials.org\/th"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/posts\/1155","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/comments?post=1155"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/posts\/1155\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/media?parent=1155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/categories?post=1155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/tags?post=1155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}