Page 163 - Data Science Algorithms in a Week
P. 163

Regression


                     Thus for the whole year, the cost will be as follows:

                               total_cost(12 months)=12*[114.565+5.515*12]=2168.94 euros

                     Visualization:

                     In the graph below, we can observe the linearity of the model represented by the
                     blue line. On the other hand, the sum of the points on the linear line is quadratic
                     in nature and is represented by the area under the line.
































                   2.  There are many ways to obtain the formula converting degrees Celsius into
                      degrees Fahrenheit. We could use R and from the initial R file take the following
                      line:

                          model = lm(celsius ~ fahrenheit, data = temperatures)

                          We then change it to:
                          model = lm(fahrenheit ~ celsius, data = temperatures)








                                                    [ 151 ]
   158   159   160   161   162   163   164   165   166   167   168