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 ?