linear-regression Questions
2
I have been working on a data set and using glmnet for linear LASSO/Ridge regressions.
For the sake of simplicity, let's assume that the model I am using is the following:
cv.glmnet(train.feature...
Selwyn asked 5/7, 2015 at 6:0
6
Solved
How can I tell R to use a certain level as reference if I use binary explanatory variables in a regression?
It's just using some level by default.
lm(x ~ y + as.factor(b))
with b {0, 1, 2, 3,...
Maishamaisie asked 6/10, 2010 at 11:46
2
Solved
I'm trying to run a simple OLS regression with a restriction that the sum of the coefficients of two variables add up to 1.
I want:
Y = α + β1 * x1 + β2 * x2 + β3 * x3,
where β1 + β2 = 1
I have...
Complacency asked 17/10, 2019 at 22:2
5
I'm new to Python and trying to perform linear regression using sklearn on a pandas dataframe. This is what I did:
data = pd.read_csv('xxxx.csv')
After that I got a DataFrame of two columns, let's...
Niggard asked 29/4, 2015 at 3:58
3
Solved
Is it possible to do polynomial regression in the GLM-package within Julia?
Considering the similarity with R syntax, I had hoped that
fit(LinearModel, @formula(y ~ poly(x,5)), dataset)
would ...
Amimia asked 7/10, 2019 at 7:34
3
The lmplot in seaborn fit regression models with intercept. However, sometimes I want to fit regression models without intercept, i.e. regression through the origin.
For example:
In [1]: import ...
Warram asked 11/1, 2016 at 15:57
1
what is difference between metrics.r2_score and acccuracy_score for calculating accuracy in a machine learning model.
When I try this:
from sklearn import metrics
from sklearn.metrics import ac...
Papeete asked 30/9, 2019 at 7:7
3
Solved
I have been trying to implement a simple linear regression model using neural networks in Keras in hopes to understand how do we work in Keras library. Unfortunately, I am ending up with a very bad...
Arquebus asked 4/7, 2018 at 22:27
1
Solved
I am taking the machine learning course from coursera. There is a topic called gradient descent to optimize the cost function. It says to simultaneously update theta0 and theta1 such that it will m...
Mastoid asked 2/9, 2019 at 1:58
3
Solved
Short version: I was using the scikit LinearRegression on some data, but I'm used to p-values so put the data into the statsmodels OLS, and although the R^2 is about the same the variable coe...
Persephone asked 26/2, 2014 at 22:34
3
Solved
I'm new to Machine Learning and currently got stuck with this.
First I use linear regression to fit the training set but get very large RMSE. Then I tried using polynomial regression to reduce the ...
Pyretotherapy asked 22/11, 2017 at 19:2
4
Solved
Regression algorithms seem to be working on features represented as numbers.
For example:
This data set doesn't contain categorical features/variables. It's quite clear how to do regression on ...
Polacca asked 30/11, 2015 at 20:21
3
Solved
I do not want main effect because it is collinear with a finer factor fixed effect, so it is annoying to have these NA.
In this example:
lm(y ~ x * z)
I want the interaction of x (numeric) and ...
Idol asked 21/11, 2016 at 21:26
1
Solved
I'm trying to solve a linear regression problem and I'm using the LinearRegression() function from sklearn. Is it possible to display the weights and bias?
Triiodomethane asked 8/5, 2019 at 11:10
2
Solved
I was looking for a way to do a linear regression under positive constraints, therefore came across the nnls approach. However I was wondering how I could get the same statistics from the nnl...
Alcaeus asked 27/11, 2014 at 21:2
6
Solved
I am trying to implement multivariate linear regression in Python using TensorFlow, but have run into some logical and implementation issues. My code throws the following error:
Attempting to use ...
Thrombus asked 15/3, 2016 at 9:55
2
Solved
I am looking for influence statistics after fitting a linear regression. In R I can obtain them (e.g.) like this:
hatvalues(fitted_model) #hatvalues (leverage)
cooks.distance(fitted_model) #Cook's...
Ministrant asked 19/9, 2017 at 15:37
2
I am using statsmodels (open to other python options) to run some linear regression. My problem is that I need the regression to have no intercept and constraint the coefficients in the range (0,1)...
Taxexempt asked 26/2, 2019 at 23:39
1
Solved
I have been unable to resolve an error when using abline(). I keep getting the warning message: In abline(model): only using the first two of 7 regression coefficients. I've been searching and seen...
Wastrel asked 17/2, 2019 at 19:48
7
Solved
I used to work with MATLAB, and for the question I raised I can use p = polyfit(x,y,1) to estimate the best fit line for the scatter data in a plate. I was wondering which resources I can rely on t...
Buggy asked 12/7, 2012 at 10:11
3
Solved
I'd like to choose the best algorithm for future. I found some solutions, but I didn't understand which R-Squared value is correct.
For this, I divided my data into two as test and training, and I...
Greater asked 10/2, 2019 at 7:4
3
Solved
So I'm finished one part of this assignment I have to do. There's only one part of the assignment that doesn't make any sense to me.
I'm doing a LinearRegression model and according to others I n...
Dichlorodifluoromethane asked 31/1, 2019 at 21:52
2
Solved
While practicing Simple Linear Regression Model I got this error:
ValueError: Expected 2D array, got scalar array instead:
array=60.
Reshape your data either using array.reshape(-1, 1) if your dat...
Anywheres asked 21/1, 2019 at 19:7
2
Solved
I am having an issue with my statsmodels OLS estimation. The model runs without any issues, but when I try to call for a summary so that I can see the actual results I get the TypeError of the axis...
Marauding asked 22/4, 2015 at 13:31
3
Solved
I want to fit a piecewise linear regression with one break point xt, such that for x < xt we have a quadratic polynomial and for x >= xt we have a straight line. Two pieces should join smooth...
Strickland asked 9/9, 2016 at 19:47
© 2022 - 2024 — McMap. All rights reserved.