{"id":18419,"date":"2023-02-02T05:08:32","date_gmt":"2023-02-02T05:08:32","guid":{"rendered":"https:\/\/club.informatix.co.jp\/?p=18419"},"modified":"2024-11-05T06:25:43","modified_gmt":"2024-11-05T06:25:43","slug":"numpy%e3%81%a7%e8%a1%8c%e5%88%97%e3%80%80%e5%9b%9e%e5%b8%b0%e5%88%86%e6%9e%90-%e3%81%9d%e3%81%ae8-%e6%9c%80%e5%b0%8f2%e4%b9%97%e6%b3%95%ef%bd%9cpython%e3%81%a7%e6%95%b0%e5%ad%a6%e3%82%92%e5%ad%a6","status":"publish","type":"post","link":"https:\/\/club.informatix.co.jp\/?p=18419","title":{"rendered":"NumPy\u3067\u884c\u5217\u3000\u56de\u5e30\u5206\u6790 \u305d\u306e8 \u6700\u5c0f2\u4e57\u6cd5\uff5cPython\u3067\u6570\u5b66\u3092\u5b66\u307c\u3046\uff01 \u7b2c29\u56de"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_83 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">\u76ee\u6b21<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a13f9e43192f\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a13f9e43192f\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/club.informatix.co.jp\/?p=18419\/#%E9%87%8D%E5%9B%9E%E5%B8%B0%E5%88%86%E6%9E%90%E3%80%80%E5%9B%9E%E5%B8%B0%E4%BF%82%E6%95%B0%E3%81%AE%E7%AE%97%E5%87%BA\" >\u91cd\u56de\u5e30\u5206\u6790\u3000\u56de\u5e30\u4fc2\u6570\u306e\u7b97\u51fa<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/club.informatix.co.jp\/?p=18419\/#%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E3%80%8Cmultiple_regression_coefficientpy%E3%80%8D%EF%BD%9C%E9%87%8D%E5%9B%9E%E5%B8%B0%E5%88%86%E6%9E%90%E5%9B%9E%E5%B8%B0%E4%BF%82%E6%95%B0%E7%AE%97%E5%87%BA%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0\" >\u30d7\u30ed\u30b0\u30e9\u30e0\u300cmultiple_regression_coefficient.py\u300d\uff5c\u91cd\u56de\u5e30\u5206\u6790\u56de\u5e30\u4fc2\u6570\u7b97\u51fa\u30d7\u30ed\u30b0\u30e9\u30e0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/club.informatix.co.jp\/?p=18419\/#%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E5%AE%9F%E8%A1%8C%E7%B5%90%E6%9E%9C\" >\u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u7d50\u679c<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/club.informatix.co.jp\/?p=18419\/#matplotlib%E3%81%AB%E3%82%88%E3%82%8B%E3%83%87%E3%83%BC%E3%82%BF%E3%81%A8%E7%B5%90%E6%9E%9C%E3%81%AE%E5%8F%AF%E8%A6%96%E5%8C%96\" >matplotlib\u306b\u3088\u308b\u30c7\u30fc\u30bf\u3068\u7d50\u679c\u306e\u53ef\u8996\u5316<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/club.informatix.co.jp\/?p=18419\/#%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E3%80%8Cregression_analysispy%E3%80%8D%E5%9B%9E%E5%B8%B0%E5%88%86%E6%9E%90%EF%BD%9C%E5%9B%9E%E5%B8%B0%E7%9B%B4%E7%B7%9A%E8%A1%A8%E7%A4%BA%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0\" >\u30d7\u30ed\u30b0\u30e9\u30e0\u300cregression_analysis.py\u300d\u56de\u5e30\u5206\u6790\uff5c\u56de\u5e30\u76f4\u7dda\u8868\u793a\u30d7\u30ed\u30b0\u30e9\u30e0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/club.informatix.co.jp\/?p=18419\/#%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E5%AE%9F%E8%A1%8C%E7%B5%90%E6%9E%9C-2\" >\u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u7d50\u679c<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/club.informatix.co.jp\/?p=18419\/#%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E3%80%8Cmultiple_regression_analysispy%E3%80%8D%E9%87%8D%E5%9B%9E%E5%B8%B0%E5%88%86%E6%9E%90%EF%BD%9C%E3%83%87%E3%83%BC%E3%82%BF%E3%83%BB%E5%9B%9E%E5%B8%B0%E7%9B%B4%E7%B7%9A%E8%A1%A8%E7%A4%BA%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0\" >\u30d7\u30ed\u30b0\u30e9\u30e0\u300cmultiple_regression_analysis.py\u300d\u91cd\u56de\u5e30\u5206\u6790\uff5c\u30c7\u30fc\u30bf\u30fb\u56de\u5e30\u76f4\u7dda\u8868\u793a\u30d7\u30ed\u30b0\u30e9\u30e0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/club.informatix.co.jp\/?p=18419\/#%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E5%AE%9F%E8%A1%8C%E7%B5%90%E6%9E%9C-3\" >\u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u7d50\u679c<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/club.informatix.co.jp\/?p=18419\/#%E8%AA%AC%E6%98%8E%E5%A4%89%E6%95%B0%E3%81%8C3%E3%81%A4%E4%BB%A5%E4%B8%8A%E3%81%82%E3%82%8B%E9%87%8D%E5%9B%9E%E5%B8%B0%E5%88%86%E6%9E%90\" >\u8aac\u660e\u5909\u6570\u304c3\u3064\u4ee5\u4e0a\u3042\u308b\u91cd\u56de\u5e30\u5206\u6790<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/club.informatix.co.jp\/?p=18419\/#%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E3%80%8Cmultiple_regression_analysis_3py%E3%80%8D%EF%BD%9C%E9%87%8D%E5%9B%9E%E5%B8%B0%E5%88%86%E6%9E%90%EF%BC%883%E5%A4%89%E6%95%B0%EF%BC%89%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0\" >\u30d7\u30ed\u30b0\u30e9\u30e0\u300cmultiple_regression_analysis_3.py\u300d\uff5c\u91cd\u56de\u5e30\u5206\u6790\uff083\u5909\u6570\uff09\u30d7\u30ed\u30b0\u30e9\u30e0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/club.informatix.co.jp\/?p=18419\/#%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E5%AE%9F%E8%A1%8C%E7%B5%90%E6%9E%9C-4\" >\u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u7d50\u679c<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"%E9%87%8D%E5%9B%9E%E5%B8%B0%E5%88%86%E6%9E%90%E3%80%80%E5%9B%9E%E5%B8%B0%E4%BF%82%E6%95%B0%E3%81%AE%E7%AE%97%E5%87%BA\"><\/span>\u91cd\u56de\u5e30\u5206\u6790\u3000\u56de\u5e30\u4fc2\u6570\u306e\u7b97\u51fa<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u56de\u5e30\u5206\u6790\u30b7\u30ea\u30fc\u30ba\u306f\u4eca\u56de\u304c\u6700\u7d42\u56de\u3067\u3059\u3002\u3053\u308c\u3067\u91cd\u56de\u5e30\u5206\u6790\u3092\u8a08\u7b97\u3059\u308b\u6e96\u5099\u304c\u3067\u304d\u307e\u3057\u305f\u3002\u3055\u3063\u305d\u304f\u8eab\u9577\u3068\u8db3\u306e\u9577\u3055\u3068\u4f53\u91cd\u306b\u3064\u3044\u3066\u306e10\u4eba\u5206\u306e\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u56de\u5e30\u4fc2\u6570\u3092\u8a08\u7b97\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u8aac\u660e\u5909\u6570\u306f2\u3064\u3001\u8eab\u9577x1\u3068\u8db3\u306e\u9577\u3055x2\u3001\u76ee\u7684\u5909\u6570\u306f\u4f53\u91cdy\u3067\u3059\u3002\u8aac\u660e\u5909\u6570\u884c\u5217X\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>X\u306e1\u5217\u76ee\u306f\u3001\u30c7\u30fc\u30bf\u6570\u306en\u500b\u3060\u30511\u3068\u306a\u308b\u306e\u3067\u3001ones = np.ones(len(x1))\u3068\u3057\u3066\u6210\u5206\u304c1\u3067\u3042\u308b1\u6b21\u5143\u914d\u5217\u3092\u3064\u304f\u3063\u3066\u304a\u304d\u307e\u3059\u30021\u6b21\u5143\u914d\u5217ones\u3001x1\u3001x2\u3092\u4e26\u3079\u3066\u884c\u5217\u3092\u3064\u304f\u308a\u307e\u3059\u304c\u3001\u3053\u306e\u884c\u5217\u306f\u578b\u304c\u56f311\u306b\u3042\u308b\u3088\u3046\u306a\u8aac\u660e\u5909\u6570\u884c\u5217X\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u3053\u308c\u3092\u8ee2\u7f6e\u3059\u308b\u3053\u3068\u3067\u8aac\u660e\u5909\u6570\u884c\u5217X\u304c\u5b8c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u5ff5\u306e\u305f\u3081print(X)\u3068\u3057\u3066\u51fa\u529b\u3057\u3066\u78ba\u304b\u3081\u3066\u307f\u307e\u3059\u3002\u3042\u3068\u306f\u56de\u5e30\u4fc2\u6570\u30d9\u30af\u30c8\u30eb\u03b8\u3092\u6c42\u3081\u308b<a href=\"https:\/\/club.informatix.co.jp\/?p=18201\" target=\"_blank\" rel=\"noopener\">\u524d\u56de28\u56de<\/a>\u306e\u516c\u5f0f(4)\u3092python\u30b3\u30fc\u30c9\u306b\u7f6e\u304d\u63db\u3048\u3066\u3044\u304d\u307e\u3059\u3002\u9006\u884c\u5217\u306fnp.array.inv()\u95a2\u6570\u3092\u7528\u3044\u307e\u3059\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E3%80%8Cmultiple_regression_coefficientpy%E3%80%8D%EF%BD%9C%E9%87%8D%E5%9B%9E%E5%B8%B0%E5%88%86%E6%9E%90%E5%9B%9E%E5%B8%B0%E4%BF%82%E6%95%B0%E7%AE%97%E5%87%BA%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0\"><\/span>\u30d7\u30ed\u30b0\u30e9\u30e0\u300cmultiple_regression_coefficient.py\u300d\uff5c\u91cd\u56de\u5e30\u5206\u6790\u56de\u5e30\u4fc2\u6570\u7b97\u51fa\u30d7\u30ed\u30b0\u30e9\u30e0<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>&gt;&gt;&gt;\u3000 # multiple_regression _coefficient.py<br \/>\n&gt;&gt;&gt;\u3000 import numpy as np<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 x1 = np.array([165, 170, 172, 175, 170, 172, 183, 187, 180, 185]) # \u8eab\u9577<br \/>\n&gt;&gt;&gt;\u3000 x2 = np.array([23, 24, 25, 27, 25, 24, 28, 29, 28, 29]) # \u8db3\u306e\u9577\u3055<br \/>\n&gt;&gt;&gt;\u3000 y = np.array([ 53, 59, 64, 75, 72, 74, 83, 87, 84, 90]) # \u4f53\u91cd<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 ones = np.ones(len(x1))<br \/>\n&gt;&gt;&gt;\u3000 X = np.array([ones, x1, x2]).T<br \/>\n&gt;&gt;&gt;\u3000 print(X)<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 theta = np.linalg.inv(X.T @ X) @ X.T @ y<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 print(f&#8217;\u03b80 = {theta[0]}&#8217;)<br \/>\n&gt;&gt;&gt;\u3000 print(f&#8217;\u03b81 = {theta[1]}&#8217;)<br \/>\n&gt;&gt;&gt;\u3000 print(f&#8217;\u03b82 = {theta[2]}&#8217;)<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E5%AE%9F%E8%A1%8C%E7%B5%90%E6%9E%9C\"><\/span>\u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u7d50\u679c<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u300cpython multiple_regression _coefficient.py\u300d\u3068\u5165\u529b\u3059\u308b\u3053\u3068\u3067\u5b9f\u884c\u3057\u307e\u3059\u3002 \u6b21\u306e\u3088\u3046\u306b\u8aac\u660e\u5909\u6570\u884c\u5217X\u30683\u3064\u306e\u56de\u5e30\u4fc2\u6570\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-large wp-image-18426\" src=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-1-1024x495.jpg\" alt=\"\" width=\"920\" height=\"445\" srcset=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-1-1024x495.jpg 1024w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-1-300x145.jpg 300w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-1-768x371.jpg 768w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-1.jpg 1235w\" sizes=\"(max-width: 920px) 100vw, 920px\" \/><\/p>\n<p>\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u5358\u56de\u5e30\u5206\u6790\u306b\u3082\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u8aac\u660e\u5909\u6570x2\u3068\u56de\u5e30\u4fc2\u6570\u03b82\u90e8\u5206\u3092\u524a\u9664\u3059\u308b\uff083\u7b87\u6240\u5909\u66f4\uff09<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-large wp-image-18427\" src=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-2-1024x478.jpg\" alt=\"\" width=\"920\" height=\"429\" srcset=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-2-1024x478.jpg 1024w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-2-300x140.jpg 300w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-2-768x358.jpg 768w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-2.jpg 1235w\" sizes=\"(max-width: 920px) 100vw, 920px\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\u306f<a href=\"https:\/\/club.informatix.co.jp\/?p=17974\" target=\"_blank\" rel=\"noopener\">\u7b2c25\u56de<\/a>\u306e\u56de\u5e30\u5206\u6790\u306e\u7d50\u679c<\/p>\n<p>\u56de\u5e30\u5f0f\uff1ay = 1.546155406776225 x1 + -197.868736051938<\/p>\n<p>\u3068\u540c\u3058\u3067\u3042\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"matplotlib%E3%81%AB%E3%82%88%E3%82%8B%E3%83%87%E3%83%BC%E3%82%BF%E3%81%A8%E7%B5%90%E6%9E%9C%E3%81%AE%E5%8F%AF%E8%A6%96%E5%8C%96\"><\/span>matplotlib\u306b\u3088\u308b\u30c7\u30fc\u30bf\u3068\u7d50\u679c\u306e\u53ef\u8996\u5316<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u6700\u5f8c\u306b\u56de\u5e30\u5206\u6790\u3068\u91cd\u56de\u5e30\u5206\u6790\u306b\u3064\u3044\u3066\u30c7\u30fc\u30bf\u3068\u7d50\u679c\u3092\u30b0\u30e9\u30d5\u306b\u8868\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u30b0\u30e9\u30d5\u306b\u3088\u308a\u30c7\u30fc\u30bf\u306e\u50be\u5411\u3092\u6982\u89b3\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u307e\u3067\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u30b0\u30e9\u30d5\u63cf\u753b\u306e\u30b3\u30fc\u30c9\u3092\u4ed8\u3051\u8db3\u3057\u305f\u306e\u304c\u30d7\u30ed\u30b0\u30e9\u30e0\u300cregression_analysis.py\u300d\u3067\u3059\u3002<\/p>\n<p>matplotlib\u30e9\u30a4\u30d6\u30e9\u30ea\u3068matplotlib\u65e5\u672c\u8a9e\u8868\u793a\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002\u30c7\u30fc\u30bf\u306e\u30d7\u30ed\u30c3\u30c8\u306fplt.scatter(x, y, c=&#8217;Blue&#8217;)\u3060\u3051\u3067\u6e08\u307f\u307e\u3059\u3002\u56de\u5e30\u76f4\u7dda\u3092\u63cf\u304f\u305f\u3081\u306b\u3044\u304f\u3064\u304b\u6e96\u5099\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u8aac\u660e\u5909\u6570x\u306e\u30c7\u30fc\u30bf\u304b\u3089x\u306e\u7bc4\u56f2\u3092\u6c7a\u3081\u307e\u3059\u3002\u56de\u5e30\u76f4\u7dda\u3092\u63cf\u304f\u305f\u3081\u306e\u5909\u6570\u304c\u5fc5\u8981\u3067\u3059\u3002x\u3068y\u306f\u30c7\u30fc\u30bf\u5b9a\u7fa9\u306b\u4f7f\u308f\u308c\u3066\u3044\u308b\u306e\u3067xx\u3068yy\u3068\u3057\u307e\u3059\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E3%80%8Cregression_analysispy%E3%80%8D%E5%9B%9E%E5%B8%B0%E5%88%86%E6%9E%90%EF%BD%9C%E5%9B%9E%E5%B8%B0%E7%9B%B4%E7%B7%9A%E8%A1%A8%E7%A4%BA%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0\"><\/span>\u30d7\u30ed\u30b0\u30e9\u30e0\u300cregression_analysis.py\u300d\u56de\u5e30\u5206\u6790\uff5c\u56de\u5e30\u76f4\u7dda\u8868\u793a\u30d7\u30ed\u30b0\u30e9\u30e0<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>&gt;&gt;&gt;\u3000 # regression_analysis.py<br \/>\n&gt;&gt;&gt;\u3000 import numpy as np<br \/>\n&gt;&gt;&gt;\u3000 import matplotlib.pyplot as plt<br \/>\n&gt;&gt;&gt;\u3000 import japanize_matplotlib<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 x = np.array([165, 170, 172, 175, 170, 172, 183, 187, 180, 185]) # \u8eab\u9577<br \/>\n&gt;&gt;&gt;\u3000 y = np.array([52, 60, 63, 65, 78, 70, 72, 85, 90, 94]) # \u4f53\u91cd<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 theta_1 = np.cov(x, y, bias=True)[0][1]\/np.var(x)<br \/>\n&gt;&gt;&gt;\u3000 theta_0 = np.mean(y) &#8211; theta_1 * np.mean(x)<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 print(f&#8217;\u56de\u5e30\u76f4\u7dda\u306e\u50be\u304d\u03b8_1 = {theta_1}&#8217;)<br \/>\n&gt;&gt;&gt;\u3000 print(f&#8217;\u56de\u5e30\u76f4\u7dda\u306e\u5207\u7247\u03b8_0 = {theta_0}&#8217;)<br \/>\n&gt;&gt;&gt;\u3000 print(f&#8217;\u56de\u5e30\u76f4\u7dda y = {theta_0} + {theta_1}x&#8217;)<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 # \u30c7\u30fc\u30bf\u3068\u56de\u5e30\u76f4\u7dda\u3000\u30b0\u30e9\u30d5\u63cf\u753b<br \/>\n&gt;&gt;&gt;\u3000 margin = 1<br \/>\n&gt;&gt;&gt;\u3000 x_min, x_max = x.min()-margin, x.max()+margin # x\u306e\u7bc4\u56f2<br \/>\n&gt;&gt;&gt;\u3000 xx = np.arange(x_min, x_max, 1) # \u56de\u5e30\u76f4\u7dda\u30b0\u30e9\u30d5\u7528\u5909\u6570:xx<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 yy = + theta_0 + theta_1 * xx # \u56de\u5e30\u76f4\u7dda \u30b0\u30e9\u30d5\u7528\u5909\u6570:xx,yy<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 plt.scatter(x, y, c=&#8217;Blue&#8217;) # \u30c7\u30fc\u30bf\u3092\u9752\u4e38\u3067\u30d7\u30ed\u30c3\u30c8<br \/>\n&gt;&gt;&gt;\u3000 plt.plot(xx, yy, c=&#8217;Red&#8217;) # \u56de\u5e30\u76f4\u7dda\u3092\u8d64\u7dda\u3067\u30d7\u30ed\u30c3\u30c8<br \/>\n&gt;&gt;&gt;\u3000 plt.xlabel(&#8216;x:\u8eab\u9577\uff08cm\uff09&#8217;)<br \/>\n&gt;&gt;&gt;\u3000 plt.ylabel(&#8216;y:\u4f53\u91cd\uff08kg\uff09&#8217;)<br \/>\n&gt;&gt;&gt;\u3000 plt.show()<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E5%AE%9F%E8%A1%8C%E7%B5%90%E6%9E%9C-2\"><\/span>\u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u7d50\u679c<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u300cpython regression_analysis.py\u300d\u3068\u5165\u529b\u3059\u308b\u3053\u3068\u3067\u5b9f\u884c\u3057\u307e\u3059\u3002\u6b21\u306e\u3088\u3046\u306b\u56de\u5e30\u4fc2\u6570\u3068\u56de\u5e30\u76f4\u7dda\u306e\u5f0f\u3001\u30b0\u30e9\u30d5\u306b\u30c7\u30fc\u30bf\uff08\u9752\u4e38\uff09\u3068\u56de\u5e30\u76f4\u7dda\uff08\u8d64\u7dda\uff09\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-large wp-image-18423\" src=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-3-1024x958.jpg\" alt=\"\" width=\"920\" height=\"861\" srcset=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-3-1024x958.jpg 1024w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-3-300x281.jpg 300w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-3-768x718.jpg 768w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-3.jpg 1235w\" sizes=\"(max-width: 920px) 100vw, 920px\" \/><\/p>\n<p>3D\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306b\u306fmatplotlib\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u4ed6\u306bmpl_toolkits.mplot3d\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002matplotlib\u65e5\u672c\u8a9e\u8868\u793a\u30e9\u30a4\u30d6\u30e9\u30ea\u3082\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002\u30c7\u30fc\u30bf\u306e\u30d7\u30ed\u30c3\u30c8\u306fax.scatter3D(x1, x2, y, color=&#8217;Blue&#8217;)\u3068\u3057\u307e\u3059\u3002<\/p>\n<p>\u56de\u5e30\u5e73\u9762\u3092\u63cf\u304f\u5834\u5408\u3082\u56de\u5e30\u76f4\u7dda\u306e\u5834\u5408\u3068\u540c\u3058\u3088\u3046\u306b\u3044\u304f\u3064\u304b\u6e96\u5099\u304c\u5fc5\u8981\u3067\u3059\u3002\u307e\u305a\u8aac\u660e\u5909\u6570x1\u3068x2\u306e\u30c7\u30fc\u30bf\u304b\u3089x1\u3068x2\u306e\u7bc4\u56f2\u3092\u6c7a\u3081\u307e\u3059\u3002\u56de\u5e30\u5e73\u9762\u3092\u63cf\u304f\u305f\u3081\u306e\u5909\u6570\u304c\u5fc5\u8981\u3067\u3059\u3002x1\u3068x2\u3068y\u306f\u30c7\u30fc\u30bf\u5b9a\u7fa9\u306b\u4f7f\u308f\u308c\u3066\u3044\u308b\u306e\u3067xx1\u3068xx2\u3068yy\u3068\u3057\u307e\u3059\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E3%80%8Cmultiple_regression_analysispy%E3%80%8D%E9%87%8D%E5%9B%9E%E5%B8%B0%E5%88%86%E6%9E%90%EF%BD%9C%E3%83%87%E3%83%BC%E3%82%BF%E3%83%BB%E5%9B%9E%E5%B8%B0%E7%9B%B4%E7%B7%9A%E8%A1%A8%E7%A4%BA%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0\"><\/span>\u30d7\u30ed\u30b0\u30e9\u30e0\u300cmultiple_regression_analysis.py\u300d\u91cd\u56de\u5e30\u5206\u6790\uff5c\u30c7\u30fc\u30bf\u30fb\u56de\u5e30\u76f4\u7dda\u8868\u793a\u30d7\u30ed\u30b0\u30e9\u30e0<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>&gt;&gt;&gt;\u3000 # multiple_regression_analysis.py<br \/>\n&gt;&gt;&gt;\u3000 import numpy as np<br \/>\n&gt;&gt;&gt;\u3000 import japanize_matplotlib<br \/>\n&gt;&gt;&gt;\u3000 import matplotlib.pyplot as plt<br \/>\n&gt;&gt;&gt;\u3000 from mpl_toolkits.mplot3d import Axes3D #3Dplot<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 # \u30c7\u30fc\u30bf\u5b9a\u7fa9<br \/>\n&gt;&gt;&gt;\u3000 x1 = np.array([165, 170, 172, 175, 170, 172, 183, 187, 180, 185]) # \u8aac\u660e\u5909\u6570 \u8eab\u9577<br \/>\n&gt;&gt;&gt;\u3000 x2 = np.array([23, 24, 25, 27, 25, 24, 28, 29, 28, 29]) # \u8aac\u660e\u5909\u6570 \u8db3\u306e\u9577\u3055<br \/>\n&gt;&gt;&gt;\u3000 y = np.array([52, 60, 63, 65, 78, 70, 72, 85, 90, 94]) # \u76ee\u7684\u5909\u6570 \u4f53\u91cd<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 ones = np.ones(len(x1))<br \/>\n&gt;&gt;&gt;\u3000 X = np.array([ones, x1, x2]).T # \u8aac\u660e\u5909\u6570\u884c\u5217<br \/>\n&gt;&gt;&gt;\u3000 print(f&#8217;\u8aac\u660e\u5909\u6570\u884c\u5217X=\\n{X}&#8217;)<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 # \u56de\u5e30\u4fc2\u6570\u30d9\u30af\u30c8\u30eb\u306e\u8a08\u7b97<br \/>\n&gt;&gt;&gt;\u3000 theta = np.linalg.inv(X.T @ X) @ X.T @ y<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 print(f&#8217;\u56de\u5e30\u4fc2\u6570 \u03b8_0 = {theta[0]}&#8217;)<br \/>\n&gt;&gt;&gt;\u3000 print(f&#8217;\u56de\u5e30\u4fc2\u6570 \u03b8_1 = {theta[1]}&#8217;)<br \/>\n&gt;&gt;&gt;\u3000 print(f&#8217;\u56de\u5e30\u4fc2\u6570 \u03b8_2 = {theta[2]}&#8217;)<br \/>\n&gt;&gt;&gt;\u3000 print(f&#8217;\u56de\u5e30\u5e73\u9762 y = {theta[0]} + {theta[1]}*x1 + {theta[2]}*x2&#8242;)<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 # \u30c7\u30fc\u30bf\u3068\u56de\u5e30\u5e73\u9762\u3000\u30b0\u30e9\u30d5\u63cf\u753b<br \/>\n&gt;&gt;&gt;\u3000 fig = plt.figure()<br \/>\n&gt;&gt;&gt;\u3000 ax = fig.add_subplot(111, projection=&#8217;3d&#8217;)<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 ax.scatter3D(x1, x2, y, color=&#8217;Blue&#8217;) # \u30c7\u30fc\u30bf\u3092\u9752\u4e38\u3067\u30d7\u30ed\u30c3\u30c8<br \/>\n&gt;&gt;&gt;\u3000 ax.set_xlabel(&#8220;x1:\u8eab\u9577\uff08cm\uff09&#8221;)<br \/>\n&gt;&gt;&gt;\u3000 ax.set_ylabel(&#8220;x2:\u8db3\u306e\u9577\u3055\uff08cm\uff09&#8221;)<br \/>\n&gt;&gt;&gt;\u3000 ax.set_zlabel(&#8220;y:\u4f53\u91cd\uff08kg\uff09&#8221;)<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 # x1\u3068x2\u306e\u7bc4\u56f2<br \/>\n&gt;&gt;&gt;\u3000 mesh_size = 1<br \/>\n&gt;&gt;&gt;\u3000 margin = 0.01<br \/>\n&gt;&gt;&gt;\u3000 x1_min, x1_max = x1.min()-margin, x1.max()+margin<br \/>\n&gt;&gt;&gt;\u3000 x2_min, x2_max = x2.min()-margin, x2.max()+margin<br \/>\n&gt;&gt;&gt;\u3000 x1_range = np.arange(x1_min, x1_max, mesh_size)<br \/>\n&gt;&gt;&gt;\u3000 x2_range = np.arange(x2_min, x2_max, mesh_size)<br \/>\n&gt;&gt;&gt;\u3000 xx1, xx2 = np.meshgrid(x1_range, x2_range)<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 yy = (theta[0] + theta[1] * xx1 + theta[2] * xx2) # \u56de\u5e30\u5e73\u9762<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 ax.plot_surface(xx1, xx2, yy, color=&#8217;red&#8217;, alpha=0.5) # alpha\u306f\u900f\u904e\u5ea6<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E5%AE%9F%E8%A1%8C%E7%B5%90%E6%9E%9C-3\"><\/span>\u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u7d50\u679c<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u300cpython multiple_regression_analysis.py\u300d\u3068\u5165\u529b\u3059\u308b\u3053\u3068\u3067\u5b9f\u884c\u3057\u307e\u3059\u3002 \u6b21\u306e\u3088\u3046\u306b\u8aac\u660e\u5909\u6570\u884c\u5217\u3068\u56de\u5e30\u4fc2\u6570\u3068\u56de\u5e30\u5e73\u9762\u306e\u5f0f\u3001\u30b0\u30e9\u30d5\u306b\u30c7\u30fc\u30bf\uff08\u9752\u4e38\uff09\u3068\u56de\u5e30\u5e73\u9762\uff08\u8d64\u7dda\uff09\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-large wp-image-18424\" src=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-4-1024x658.jpg\" alt=\"\" width=\"920\" height=\"591\" srcset=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-4-1024x658.jpg 1024w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-4-300x193.jpg 300w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-4-768x494.jpg 768w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-4.jpg 1235w\" sizes=\"(max-width: 920px) 100vw, 920px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E8%AA%AC%E6%98%8E%E5%A4%89%E6%95%B0%E3%81%8C3%E3%81%A4%E4%BB%A5%E4%B8%8A%E3%81%82%E3%82%8B%E9%87%8D%E5%9B%9E%E5%B8%B0%E5%88%86%E6%9E%90\"><\/span>\u8aac\u660e\u5909\u6570\u304c3\u3064\u4ee5\u4e0a\u3042\u308b\u91cd\u56de\u5e30\u5206\u6790<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u4ee5\u4e0a\u306e\u91cd\u56de\u5e30\u5206\u6790\u306f\u8aac\u660e\u5909\u65702\u3064\u306e\u5834\u5408\u3067\u3059\u3002\u7d50\u679c\u304c\u56de\u5e30\u5e73\u9762\u3068\u3057\u30663D\u53ef\u8996\u5316\u3067\u304d\u308b\u305f\u3081\u91cd\u56de\u5e30\u5206\u6790\u306e\u7406\u89e3\u306b\u306f\u3046\u3063\u3066\u3064\u3051\u3067\u3059\u3002<\/p>\n<p>\u8aac\u660e\u5909\u6570\u304c3\u3064\u4ee5\u4e0a\u3042\u308b\u91cd\u56de\u5e30\u5206\u6790\u3067\u306f\u56de\u5e30\u5f0f\u3092\u53ef\u8996\u5316\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u304c\u3001\u30ea\u30b9\u30c84\u306e\u8aac\u660e\u5909\u6570\u3092x3\u3001x4\u3001\u2026\u3068\u5897\u3084\u3059\u3053\u3068\u3067\u56de\u5e30\u5f0f\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u8eab\u9577\u3001\u8db3\u306e\u9577\u3055\u306b\u52a0\u3048\u3066\u5e74\u9f62\u3092\u8aac\u660e\u5909\u6570x3\u3068\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u5909\u66f4\u3059\u308b\u7b87\u6240\u306f\u6b21\u306e4\u884c\u3067\u3059\u3002<\/p>\n<p>&gt;&gt;&gt;\u3000 x3 = np.array([43, 20, 54, 27, 33, 19, 28, 40, 29, 50]) # \u8aac\u660e\u5909\u6570 \u5e74\u9f62<br \/>\n&gt;&gt;&gt;\u3000 X = np.array([ones, x1, x2, x3]).T # \u8aac\u660e\u5909\u6570\u884c\u5217<br \/>\n&gt;&gt;&gt;\u3000 print(f&#8217;\u56de\u5e30\u4fc2\u6570 \u03b8_3 = {theta[3]}&#8217;)<br \/>\n&gt;&gt;&gt;\u3000 print(f&#8217;\u56de\u5e30\u5f0f y = {theta[0]} + {theta[1]}*x1 + {theta[2]}*x2 + {theta[3]}*x3&#8242;)<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E3%80%8Cmultiple_regression_analysis_3py%E3%80%8D%EF%BD%9C%E9%87%8D%E5%9B%9E%E5%B8%B0%E5%88%86%E6%9E%90%EF%BC%883%E5%A4%89%E6%95%B0%EF%BC%89%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0\"><\/span>\u30d7\u30ed\u30b0\u30e9\u30e0\u300cmultiple_regression_analysis_3.py\u300d\uff5c\u91cd\u56de\u5e30\u5206\u6790\uff083\u5909\u6570\uff09\u30d7\u30ed\u30b0\u30e9\u30e0<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>&gt;&gt;&gt;\u3000 # multiple_regression_analysis_3.py<br \/>\n&gt;&gt;&gt;\u3000 import numpy as np<br \/>\n&gt;&gt;&gt;\u3000 import japanize_matplotlib<br \/>\n&gt;&gt;&gt;\u3000 import matplotlib.pyplot as plt<br \/>\n&gt;&gt;&gt;\u3000 from mpl_toolkits.mplot3d import Axes3D #3Dplot<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 # \u30c7\u30fc\u30bf\u5b9a\u7fa9<br \/>\n&gt;&gt;&gt;\u3000 x1 = np.array([165, 170, 172, 175, 170, 172, 183, 187, 180, 185]) # \u8aac\u660e\u5909\u6570 \u8eab\u9577<br \/>\n&gt;&gt;&gt;\u3000 x2 = np.array([23, 24, 25, 27, 25, 24, 28, 29, 28, 29]) # \u8aac\u660e\u5909\u6570 \u8db3\u306e\u9577\u3055<br \/>\n&gt;&gt;&gt;\u3000 x3 = np.array([43, 20, 54, 27, 33, 19, 28, 40, 29, 50]) # \u8aac\u660e\u5909\u6570 \u5e74\u9f62<br \/>\n&gt;&gt;&gt;\u3000 y = np.array([52, 60, 63, 65, 78, 70, 72, 85, 90, 94]) # \u76ee\u7684\u5909\u6570 \u4f53\u91cd<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 ones = np.ones(len(x1))<br \/>\n&gt;&gt;&gt;\u3000 X = np.array([ones, x1, x2, x3]).T # \u8aac\u660e\u5909\u6570\u884c\u5217<br \/>\n&gt;&gt;&gt;\u3000 print(f&#8217;\u8aac\u660e\u5909\u6570\u884c\u5217X=\\n{X}&#8217;)<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 # \u56de\u5e30\u4fc2\u6570\u30d9\u30af\u30c8\u30eb\u306e\u8a08\u7b97<br \/>\n&gt;&gt;&gt;\u3000 theta = np.linalg.inv(X.T @ X) @ X.T @ y<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000 print(f&#8217;\u56de\u5e30\u4fc2\u6570 \u03b8_0 = {theta[0]}&#8217;)<br \/>\n&gt;&gt;&gt;\u3000 print(f&#8217;\u56de\u5e30\u4fc2\u6570 \u03b8_1 = {theta[1]}&#8217;)<br \/>\n&gt;&gt;&gt;\u3000 print(f&#8217;\u56de\u5e30\u4fc2\u6570 \u03b8_2 = {theta[2]}&#8217;)<br \/>\n&gt;&gt;&gt;\u3000 print(f&#8217;\u56de\u5e30\u4fc2\u6570 \u03b8_3 = {theta[3]}&#8217;)<br \/>\n&gt;&gt;&gt;\u3000 print(f&#8217;\u56de\u5e30\u5f0f y = {theta[0]} + {theta[1]}*x1 + {theta[2]}*x2 + {theta[3]}*x3&#8242;)<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E5%AE%9F%E8%A1%8C%E7%B5%90%E6%9E%9C-4\"><\/span>\u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u7d50\u679c<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u300cpython multiple_regression_analysis_3.py\u300d\u3068\u5165\u529b\u3059\u308b\u3053\u3068\u3067\u5b9f\u884c\u3057\u307e\u3059\u3002 \u6b21\u306e\u3088\u3046\u306b\u8aac\u660e\u5909\u6570\u884c\u5217\u3001\u56de\u5e30\u4fc2\u6570\u3001\u56de\u5e30\u5f0f\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-large wp-image-18425\" src=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-5-1024x663.jpg\" alt=\"\" width=\"920\" height=\"596\" srcset=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-5-1024x663.jpg 1024w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-5-300x194.jpg 300w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-5-768x497.jpg 768w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-5.jpg 1235w\" sizes=\"(max-width: 920px) 100vw, 920px\" \/><\/p>\n<p>\u4ee5\u4e0a\u306ePython\u30b3\u30fc\u30c9\u306f\u300cPython\u3066\u3099\u6570\u5b66\u3092\u5b66\u307b\u3099\u3046\uff01\u7b2c29\u56de.ipynb\u300d\u3068\u3057\u3066\u307e\u3068\u3081\u3066\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u30d5\u30a1\u30a4\u30eb\u306f\u6b21\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3002<br \/>\n<a href=\"https:\/\/drive.google.com\/file\/d\/1VUVzP1OpWdniGqeW-Dkiif3NLn4soktp\/view?usp=share_link\" target=\"_blank\" rel=\"noopener\">https:\/\/drive.google.com\/file\/d\/1VUVzP1OpWdniGqeW-Dkiif3NLn4soktp\/view?usp=share_link<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u91cd\u56de\u5e30\u5206\u6790\u3000\u56de\u5e30\u4fc2\u6570\u306e\u7b97\u51fa \u56de\u5e30\u5206\u6790\u30b7\u30ea\u30fc\u30ba\u306f\u4eca\u56de\u304c\u6700\u7d42\u56de\u3067\u3059\u3002\u3053\u308c\u3067\u91cd\u56de\u5e30\u5206\u6790\u3092\u8a08\u7b97\u3059\u308b\u6e96\u5099\u304c\u3067\u304d\u307e\u3057\u305f\u3002\u3055\u3063\u305d\u304f\u8eab\u9577\u3068\u8db3\u306e\u9577\u3055\u3068\u4f53\u91cd\u306b\u3064\u3044\u3066\u306e10\u4eba\u5206\u306e\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u56de\u5e30\u4fc2\u6570\u3092\u8a08\u7b97\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002 &#8230; <\/p>\n","protected":false},"author":4,"featured_media":18423,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,464,526],"tags":[65,750],"class_list":["post-18419","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-4","category-hito-star-mathmatics","category-526","tag-python","tag-750"],"jetpack_featured_media_url":"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/02\/20230201-3.jpg","_links":{"self":[{"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/18419","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18419"}],"version-history":[{"count":8,"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/18419\/revisions"}],"predecessor-version":[{"id":20765,"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/18419\/revisions\/20765"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=\/wp\/v2\/media\/18423"}],"wp:attachment":[{"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18419"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}