Linear Regression in R and Python - रस ग्रहणाचे प्रयत्न
R library functions for Linear Regression
package: stats
function: lm()
Returns an object of type: list
> typeof(lm.D9)
[1] "list"
> class(lm.D9)
[1] "lm"
> attributes(lm.D9)
$`names`
[1] "coefficients" "residuals" "effects" "rank"
[5] "fitted.values" "assign" "qr" "df.residual"
[9] "contrasts" "xlevels" "call" "terms"
[13] "model"
$class
[1] "lm"
Further reading:
https://www.machinelearningplus.com/machine-learning/complete-introduction-linear-regression-r/
Alternatives to lm:
http://www.sumsar.net/blog/2015/03/a-speed-comparison-between-flexible-linear-regression-alternatives-in-r/
Python library functions for Linear Regression
library: scikitlearnobject? : linear_model
Example: copied from python documentation
Good read:
http://scikit-learn.org/stable/modules/linear_model.html
Comments
Post a Comment