{"categories":["python","numpy"],"blog_title":"\u3068\u3042\u308b\u65b0\u5352SE\u306e\u5099\u5fd8\u9332","version":"1.0","published":"2018-11-30 09:15:11","title":"\u6700\u5c0f\u4e8c\u4e57\u6cd5\u3067\u7dda\u5f62\u8fd1\u4f3c(python,numpy)","author_name":"kobakenkken","url":"https://kenbo.hatenablog.com/entry/2018/11/30/091511","provider_url":"https://hatena.blog","height":"190","type":"rich","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkenbo.hatenablog.com%2Fentry%2F2018%2F11%2F30%2F091511\" title=\"\u6700\u5c0f\u4e8c\u4e57\u6cd5\u3067\u7dda\u5f62\u8fd1\u4f3c(python,numpy) - \u3068\u3042\u308b\u65b0\u5352SE\u306e\u5099\u5fd8\u9332\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","image_url":"https://cdn-ak.f.st-hatena.com/images/fotolife/k/kobakenkken/20181130/20181130091444.png","blog_url":"https://kenbo.hatenablog.com/","description":"python\u306enumpy\u3067\u6700\u5c0f\u4e8c\u4e57\u6cd5\u3067\u7dda\u5f62\u8fd1\u4f3c\u3057\u50be\u304d\uff0c\u5207\u7247\uff0c\u56de\u5e30\u5f0f\u3092\u53d6\u5f97\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\uff0e ```python # -*- coding: utf-8 -*-import numpy as npimport matplotlib.pyplot as plt def main(): X = [1,2,3,4,5] Y = [1.1, 2.1, 2.8, 4.3, 5.1] A = np.array([X,np.ones(len(X))]) A = A.T #\u7dda\u5f62\u56de\u5e30(np.linalg.lstsq)\u3092\u5b9f\u884c\u3057\u3066a:\u50be\u304d\u3001b:\u5207\u7247\u3092\u53d6\u5f97\u3002 a,b = np.linalg.lstsq(A,Y)[0] \u2026","author_url":"https://blog.hatena.ne.jp/kobakenkken/","provider_name":"Hatena Blog","width":"100%"}