# linear regression with more than one weighted variable

I have a data set with the variables: y,n,date,x1,x2,x3. I'm trying to predict y through x1,x2,x3 - categorical variables. I'm building a linear regression model in python. I'm interested in using weights:

• n - number of observation per row
• date - give more weight to more recent data (will use some power function here)

I know how to use regression with one variable that represent weight:

regr = linear_model.LinearRegression()
model1=regr.fit(X, y,sample_weight=n)


My question is- does it make sense to use two weighting variables (n,date) ? and how can I do it in python ?

Thanks

• I think you mean "does it make sense ..." rather than does it make since...". – Michael Chernick Apr 23 '17 at 11:26
• The conceptual part of your question may well be answered on this site. The python part would need to be asked elsewhere. – rolando2 Apr 23 '17 at 12:08
• To my understanding, weight should be the inverse of variance. – SmallChess Apr 23 '17 at 12:18
• You cannot use different weights for different variables in sklearn. – DYZ Apr 24 '17 at 6:03