Aidemy 2020/10/28
Hello, it is Yope! I am a liberal arts student, but I was interested in the possibilities of AI, so I went to the AI-specialized school "Aidemy" to study. I would like to share the knowledge gained here with you, and I am summarizing it on Qiita. I am very happy that many people have read the previous summary article. Thank you! This is the first post of supervised learning (regression). Nice to meet you.
What to learn this time ・ About supervised learning (regression) ・ Linear regression method
・ There are three methods for machine learning. "Supervised learning," "unsupervised learning," and "reinforcement learning." ・ Of these, supervised learning can be divided into two categories: “classification” and “regression”. The regression we learn this time predicts continuous values such as __stock prices and market prices. __
-Linear regression is __ that predicts the movement of the data after that from the formula (graph = linear) of the data that is already known. The graph at this time is always a straight line (linear function).
-The coefficient of determination __ indicates how well the data predicted by linear regression and the actual data match. -In scikit-learn used for supervised learning, the coefficient of determination takes a value between __0 and __. It can be said that the larger the value, the higher the degree of agreement. -When outputting the coefficient of determination, use __print (model.score (test_X, test_y)) __.
-Linear simple regression is a linear regression __ that obtains one data (y) to be predicted from one data (x). -That is, it means that __a and b are inferred, assuming that the data can be represented by "y = ax + b". -For guessing a and b, one is the __least squares method __. This is to set a and b such that __ the sum of the squares of the difference between the actual y and the estimated y (that is, ax + b) is minimized. -The reason why the difference is squared by this method is that it is not necessary to consider the positive or negative of the data.
-To use linear (simple) regression, use __ "model = LinearRegression ()" __.
-Execute linear simple regression![Screenshot 2020-10-28 22.51.22.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/698700/81a106d8- 132a-1d47-1c60-aeb09af5f07b.png)
-__ Linear multiple regression __ is a linear regression in which one data (y) is to be predicted and multiple data (x1, x2 ...) __ are used for the prediction. .. -That is, it means guessing a and b, assuming that the data can be represented by "y = a1x1 + a2x2 ... + b". -Even in linear multiple regression, the prediction of a and b is performed by the least squares method. -Also, you can use LinearRegression (). It automatically determines whether it is simple regression or multiple regression.
-Perform linear multiple regression![Screenshot 2020-10-28 22.52.10.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/698700/e8978f4f- 77ce-3b68-24fd-8d851359c030.png)
-Linear regression, which is one of supervised learning (regression), predicts the movement of data after that from an already known data formula (graph = linear). -Linear regression includes "linear simple regression" which predicts one and "linear multiple regression" which has multiple predictions.
This time is over. Thank you for reading until the end.
Recommended Posts