Top "Linear-regression" questions

for issues related to linear regression modelling approach

Converting Numpy Lstsq residual value to R^2

I am performing a least squares regression as below (univariate). I would like to express the significance of the result …

python numpy linear-regression
Linear Regression with sklearn using categorical variables

I am trying to run a usual linear regression in Python using sk-learn, but I have some categorical data that …

python scikit-learn linear-regression categorical-data
Force certain parameters to have positive coefficients in lm()

I would like to know how to constrain certain parameters in lm() to have positive coefficients. There are a few …

r regression linear-regression glm lm
How to find the best degree of polynomials?

I'm new to Machine Learning and currently got stuck with this. First I use linear regression to fit the training …

python machine-learning linear-regression polynomials
How to calculate R Squared value for Lasso regression using glmnet in R

I am performing lasso regression in R using glmnet package: fit.lasso <- glmnet(x,y) plot(fit.lasso,…

r linear-regression glmnet lasso-regression
Applying lm() and predict() to multiple columns in a data frame

I have an example dataset below. train<-data.frame(x1 = c(4,5,6,4,3,5), x2 = c(4,2,4,0,5,4), x3 = c(1,1,1,0,0,1), x4 = c(1,0,1,1,0,0), x5 = c(0,0,0,1,1,1)) …

r regression linear-regression lm mlm
6th degree curve fitting with numpy/scipy

I have a very specific requirement for interpolating nonlinear data using a 6th degree polynomial. I've seen numpy/scipy routines (…

python numpy scipy curve-fitting linear-regression
R: predict.lm() not recognizing an object

> reg.len <- lm(chao1.ave ~ lg.std.len, b.div) # b.div is my data frame imported …

r linear-regression lm predict
Multiple Regression

In order to combine 3 different estimators of the same variable I need to implement a multiple regression method in Java (…

java regression linear-regression least-squares
statsmodels add_constant for OLS intercept, what is this actually doing?

Reviewing linear regressions via statsmodels OLS fit I see you have to use add_constant to add a constant '1…

python linear-regression statsmodels