Questions tagged [linear-regression]

Techniques for analyzing the relationship between one (or more) "dependent" variables and "independent" variables.

Filter by
Sorted by
Tagged with
2
votes
0answers
8 views

Adding high p-value and low R square features in linear regression model to improve result

I am working on a linear regression problem. The features that has been selected for anslysis using both p-value and domian knowledge has improved the model R2 (0.25 to 0.85) and RMSE. Butthe issue is ...
0
votes
0answers
12 views

Linear and logistic regression output with same neural network

it seems like this should be a very common task, but I have not found anything useful on my research: How can I do linear and logistic regression with the same neural network? By example, what I mean ...
1
vote
1answer
27 views

Find the Weight Values using Linear Regression Analysis in Python

I have the equation below, which is a noise quality metric of an image: If the BIQS is 1, it means the image is clean. Else, if ...
0
votes
0answers
13 views

Timeseries prediction with linear regression?

I'm new in the data science field and I need some guidance on best practices. I have a data set coming from a timeseries where I have the displacement at a point of a structural element and the ...
0
votes
0answers
8 views

Opposite results using statsmodels and seaborn regplot

I use regplot using the following code: sns.regplot(x = "Year", y = "Data_Value", data = NOAA_TMAX_s ); and I obtain the following figure: showing clearly that ...
0
votes
0answers
7 views

Does severe multicollinearity affect solving linear regression by gradient descent?

Since OLS may fail when there is severe/near perfect multicollinearity, how would gradient descent perform in such a scenario? Does it converge at the minima? (My guess is, Cost function of linear ...
5
votes
3answers
52 views

How to normalize data without knowing the min and max values?

I have a Lending club dataset from Kaggle; it contains many different columns: there are for example dummy variables, years, amount of the loan...ect I want to normalize the data in the training and ...
0
votes
0answers
13 views

Building a gradient descent linear regression model from scratch on Python

I am trying to build a liner regression model using batch gradient descent to minimize the cost function. However, I am clearly doing something wrong because when I try to plot my cost history after ...
1
vote
1answer
20 views

I don't understand RidgeCV's fit_intercept, and how to use it for my data

Alright, I have an assignment that makes me calculate weights for a function with different terms. At first, I thought I might just leave the weight for the term $1$ out, and instead use the intercept....
0
votes
0answers
37 views

Workng of LME model used for a set of category variable(s) and a continuous variable?

LME models are being used to analyze the effect of continuos data and category data. Is this model appropriate for checking the effect of two independent variables - one with continuous values and ...
0
votes
0answers
12 views

scaling credit risk scorecard

I need to build a credit risk scorecard using logistic and linear regression. The variables using to predict are all dummies, where each dummy is a bin of some variable. Let's say the variable age, I ...
1
vote
0answers
23 views

Linear regression : ValueError: operands could not be broadcast together with shapes (3,) (1338,)

I try to use linear regression for insurance data . But had error on the when try to call a function with features parameter. Here is my code: ...
0
votes
0answers
15 views

Specifying priors in rstanarm for hierarchical model

We are given the model $$ \begin{align*} y_{ij} & \sim \mathsf{Normal}(\alpha_j + \beta x_i, \sigma^2)\\ \alpha_j & \sim \mathsf{Normal}(\gamma_0 + \gamma_1 u_j, \tau^2) \end{align*} $$ with ...
3
votes
3answers
56 views

Difference between Ridge and Linear Regression

From what I have understood, the Ridge Regression is just having the loss function for an optimization problem with the addition of the regularization term (L2 Norm in the case of Ridge). However I am ...
0
votes
1answer
28 views

Change date in linear regression model [closed]

Im trying to run a linear regression model with Years as the x variable and temperature on the y variable but I keep getting errors. I manage to run a regression model using the below code and also ...
0
votes
1answer
30 views

Covariance matrix in linear regression

I have read about linear regression and interpreting OLS results i.e coefficients, t-value, p-value. But unable to find any material related to covariance matrix in linear regression. I was reading ...
3
votes
1answer
63 views

Linear regression assumptions

I have read that we make the following assumption for linear regression: 1. Linearity (correct functional form) 2. Constant error variance (homoskedasticity) 3. Independent error terms (no ...
4
votes
1answer
188 views

How to solve the gradient descent on a linear classification problem?

I have a problem which i have attached as an image. Problem is in image attached what I understand error function is given by: $e(y, \hat y)=0$ if $y \cdot a(x-b) \ge 1$ or $e(y, \hat y) = 1-y\cdot ...
0
votes
0answers
15 views

Linear Mixed Model vs Variable Interaction

I am studying relationship between 'Y' and two continuous vars(X1, X2) + one categorical var (C). I think the categorical variable not only influence 'Y', but also changes coefficients of continuous ...
-1
votes
1answer
24 views

Linear Regression to predict a growing variable with time

Can we use Multiple Linear Regression to predict a dependent variable that is growing exponentially with time?
-1
votes
1answer
16 views

Why don't the dimensions in this linear regression equation match up?

I'm going through an article on linear regression, and they give the following formula for computing estimates: The convention is that all vectors are column vectors. So if ...
2
votes
0answers
39 views

Bias Formula in Machine Learning expanded using ground truth

Why is Bias calculated for $f(x)$? Shouldn't it be calculated for $Y$ (which is $f(x)$ + Noise $\epsilon$)? We are fitting our model to $Y$, So shouldn't we be calculating bias wrt to $Y$? Also, I ...
1
vote
1answer
31 views

implementing an algorithm that mixes data clustering and linear regression

i have the following dataframe available in the link as a csv, it conveys information about stars. more specifically - column ID represents arbitrary ID of sample. column z represents my target ...
4
votes
2answers
96 views

Correlation vs Coefficient of multiple linear regression

I have 10000 samples. There are 4 independent variables and 1 dependent variable. The independent variables are all centered with 0 mean. I found the correlation between each of these variables ...
0
votes
3answers
30 views

weather and products sell relationship which one should be the target variable?

Let say I have this dataset kor_cat is the categories of the product like(noodle,cookie....) and the kor_qty is the number of product selled I want to know the weather has a relation with the ...
1
vote
2answers
62 views

fbprophet - adding regressor

During linear regression classes in academia, it is taught that including trivial/irrelevant features to the model decreases its ability to predict more accurately. In fbprophet, there is this ...
-1
votes
1answer
20 views

How to randomly split the data set into multiple different sets:(training 70%:validation 10%(optional):testing 20%) in R?

I have a dataset with 4 predictor variables X1, X2, X3, X4, and one response variable Y. I have been asked to check the correlation between these variables and see how they are related and then use a ...
1
vote
2answers
56 views

Which data set to use to find correlation between Predictor and response variables? Test data set? Training data set? or the entire data set?

I have a dataset with 4 predictor variables X1, X2, X3, X4, and one response variable Y. I have been asked to check the correlation between these variables and see how they are related and then use ...
0
votes
1answer
26 views

Can categorical features be linearly distributed? [closed]

Still on my early days, so I cannot really say whether categorical values can be used when linear regression is a key element. Judging from the below plot, based on my dataset, I'd say this possible (...
1
vote
1answer
18 views

How to do backward features elimination when considering interactions between them

I have a multi linear regression problem, $Y$ is my target and $X_1, X_2, X_3$ are my features. In my regression, I consider the interaction between $X_1, X_2, X_3$ and I add a bias. So my problem ...
1
vote
1answer
52 views

Is converting a categorical value into numerical needed to find a correlation?

I have a small dataset of 1300 observations x 20 features. They are all numerical but one, which is categorical; this was calculated independently and relates to each observation in any case. I'm now ...
1
vote
1answer
45 views

What is the minimum number of data to create a function?

I gonna introduce the problematic like this: Let's say there are individuals with different capacities/skills. These capacities/skills are depending of the environment: nature of the floor, weather ...
1
vote
0answers
58 views

Effect of a single variable in a linear model

In a multiple linear regression (MLR) model, people normally look at the relationship between each predictor and the response variable to see if it is linear. However, in my example below, I show that ...
0
votes
0answers
13 views

Matlab - Financial Modeling, Linear Regression with Prior

Am trying to implement this equation from the book Doing Data Science Straight Talk from the frontline, In chapter 6, page 161, equation below: From what i can tell it is pretty much an enchanced ...
0
votes
1answer
20 views

Why my cost function is so high?

I am trying to implement the gradient descent algorithm from scratch and use it on the Boston dataset. Here is what I have so far: ...
0
votes
0answers
21 views

Gradient Descent on Boston Dataset

I am trying to implement the gradient descent algorithm from scratch and use it on the Boston dataset. Here is what I have so far: ...
0
votes
1answer
40 views

How to handle potential interactions when one-hot encoding?

Let's say I have two categorical features: Movie, Director. I one-hot encode both the Movie and Director features for use in a linear regression model. The problem is that two or more movies may be ...
2
votes
1answer
22 views

Why does reducing polynomial regression to linear regression work?

Getting into machine learning, have a reasonable background in statistics and understand the basic principles of linear algebra (matrix multiplication etc.) - but am having a damn hard time figuring ...
4
votes
2answers
207 views

Compare Coefficients of Different Regression Models

in my project, I am using asuite of shallow and deep learning models in order to see which has the best performance on my data. However, in the pool of shallow machine learning models, I want to be ...
1
vote
0answers
46 views
2
votes
2answers
29 views

Confidence intervals in multivariate linear regression

I am fitting my data to a multivariate linear regression $Y = BX + \Xi$, where the response is bivariate $Y\in R^{n\times 2}$, and the predictor is uni-variate but elevated to the projective plane to ...
0
votes
2answers
77 views

In linear regression why we generally use RMSE instead of MSE

In linear regression, why we generally use RMSE instead of MSE. The rational I know is its easy to minimize the error in RMSE instead of MSE by Gredient Decent. But need to know exact reason.
2
votes
2answers
87 views

How to reduce the error in linear regression [closed]

In linear regression, how can we minimize the error term?
1
vote
0answers
27 views

Need help regarding my thesis project related to Data Analysis [closed]

I am working on a project with a company that manufactures Injection molding machines. I am to perform data analysis on some selected parameters as a part of my thesis to tell the company if from ...
1
vote
1answer
22 views

Fitting glm without explicit declaration of each covariate

When I fit a linear model with many predictor variables, I can avoid writing all of them by using . as follows: ...
1
vote
2answers
43 views

Predict the average temperature for next 30 years

Objective: I want to predict the average temperature for next 30 years. Q1: What type of dataset is suitable for this (what columns should it contain) Q2: What are the independent variables for ...
3
votes
1answer
36 views

NA in LR model summary(R)

So, i was trying to improve mr LR model performing multiple linear regression on a dataset. I had a categorical variable region Region(variable): Midwest Northeast South West I made dummy ...
2
votes
2answers
45 views

Should I create a separate column for each Id value in a feature column or can I use the feature column as it is?

I am working on developing a model for predicting, revenue that a movie will make. One of the features in the training set contains id of the series that a movie belongs to.Say, Star Wars series has ...
1
vote
3answers
95 views

Linear Regression finding best fit

I am trying to fit a LR model with an obvious objective to find a best fit. model which can achieve lowest RSS. I have many independent variable so i have decided to yous Backward selection (We start ...
2
votes
0answers
32 views

Omnibus and R square improvements for OLS model

Checking on this community if any one can help on below problem posted by me on stats.stackexchange. https://stats.stackexchange.com/q/441653/266047 Detailed question is as below: ...

1
2 3 4 5
10