Questions tagged [linear-regression]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
14 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
35 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 ...
0
votes
0answers
13 views

Why is it giving me error of “Expected 2D array, got 1D array instead” [migrated]

I used regressor.fit([X_train], [Y_train]), it did worked but when I ran the below code ,it gave me the following error "ValueError: shapes (1,9) and (21,21) not aligned: 9 (dim 1) != 21 (dim 0)" ...
1
vote
1answer
40 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
43 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
12 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
12 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
26 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
18 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
174 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
41 views
2
votes
1answer
18 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
55 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
52 views

How to reduce the error in linear regression [closed]

In linear regression, how can we minimize the error term?
1
vote
0answers
26 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
20 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
39 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
30 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
41 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
81 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
25 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: ...
2
votes
1answer
55 views

For a square matrix of data, I achieve $R^2=1$ for Linear Regression and $R^2=0$ for Lasso. What's the intuition behind?

For a square matrix of random data, N columns and N rows. I am fitting two models, linear regression and Lasso. For the linear regression, I achieve a perfect score in train set, while in the Lasso I ...
0
votes
1answer
26 views

How to pass linear regression weights to Xgboost regressor?

I'm trying to build an xgboost regressor or a catboost regressor for a task. I have a working linear regression model. I also trained an xgboost regressor model for the task but it was worse than the ...
0
votes
0answers
19 views

Ensemble two models

I have regression task and I am predicting here with linear regression and randomforest models. Need some hints or code example how to ensemble them (averaging already done). Here are my model ...
1
vote
1answer
58 views

What is the difference between a regular Linear Regression model and xgboost with objective set to “reg:linear”?

As I understand it, a regular linear regression model already minimizes for squared error, which means that it is the theoretical best prediction for this metric. Does xgboost's "reg:linear" ...
1
vote
1answer
65 views
0
votes
1answer
73 views

How to interpret Variance Inflation Factor (VIF) results?

From various books and blog posts, I understood that the Variance Inflation Factor (VIF) is used to calculate collinearity. They say that VIF till 10 is good. But I have a question. As we can see in ...
2
votes
0answers
57 views

Why does classifier chain ask for at least 2 classes, when I have it

I'm using Classifier Chain with logistic regression and when i try to use fit, i get This solver needs samples of at least 2 classes in the data, but the data contains only one class: 1 but I'm ...
0
votes
1answer
17 views

How do I plot the predictions made by a LinearRegression model?

I have made a linear regression using sklearn. I am wondering if there is a convenient way where I can plot the prediction versus a specified variable? Alternatively, is there any other good way of ...
2
votes
5answers
61 views

How do you predict a continuous variable when all your independent variables are categorical

I am new to data science and ML. Recently I have been given a sales dataset which contains weekly sales of a fashion brand. It has information about product like category(t shirt, polo shirt, cotton ...
1
vote
1answer
22 views

How should I improve my Vectorized Gradient descent linear regression model?

I wrote a vectorized Gradient descent implementation of the linear regression model. The Dataset looks something like: It's Not Working properly as I am getting negative R Squared error I don't ...
2
votes
2answers
64 views

Does Feature Normalization affect Gradient Descent | Linear Regression

am new to datascience and i want to learn linear regression so i coded linear regression from scratch and performed gradient descent to find the best $w_\theta$ and $b_\theta$ values using a tutorial. ...
0
votes
0answers
31 views

Linear regression plotting abline()

I have a ufc data set which i got and started cleaning for my own practice This the link to data:-https://www.kaggle.com/rajeevw/ufcdata#raw_fighter_details.csv and using ...
1
vote
3answers
42 views

R-square or adjusted R-square for one variable model?

I have model like y=mx. Since the adjusted R2 tells you the percentage of variation explained by only the independent variables that actually affect the dependent variable and I have only one ...
0
votes
1answer
11 views

From a mix of real-world and back-calculated data how to remove the part that was back-calculated?

I have a geostatistical dataset and I've been building linear regression model, but when I plotted the data I've noticed that part of the data shows an absolute straight line trend, i.e. it is most ...
1
vote
1answer
34 views

Multicollinearity and impact of individual features

Assume the following scenario: I have four features: $x_1$, $x_2$, $x_3$, and $x_4$ There are non-negligible multi-collinearity among the features. I want to predict $y$ (response variable) with ...
0
votes
1answer
25 views

Andrew Ngs Class - Why Did He Change up the Cost Function?

I am taking Andrew Ng's Machine Learning Intro class. Looks like he changed the cost function without any explanation in the second week. Specifically: He no longer squares each deviation between the ...
0
votes
1answer
64 views

Applying Standardization OLS estimator

I have basic understanding of how to perform linear regression with sklearn and statsmodels. There are several questions that I would like to ask regarding Linear Regression (OLS estimator) : Is ...
0
votes
1answer
133 views

Regression: What defines Linear and non-linear models or functions

Linear regression is used when there is a linear relationship between the input and output variables. Does this linear relationship mean that there is no power over the variables or the parameters? In ...
0
votes
2answers
43 views
0
votes
1answer
37 views

Linear regression doesn't return the expected number of $\beta_i$

I have a dataset of precincts and results of parties on different elections. After reading this article I really wanted to use linear regression to answer the question : how did voters changed their ...
0
votes
1answer
89 views

Correcting for one of multiple strong batch effects in a dataset

I am wondering which statistical tools to use when analysing data that have multiple strong batch effects (distributions vary from one batch to another). I would like to correct batch effect when it ...
0
votes
1answer
21 views

Where to get the Datascience Use cases for practice [duplicate]

I just started learning data science. I have gone through some of the courses in coursera & udemy, now i want to practice what i have learned. What i want to know is from where can i get the Use ...
0
votes
1answer
139 views

When using Absolute Error in Gradient Descent, how to calculate the derivative?

What is the derivative of the Loss Function (Absolute Error) with respect to the feature weights that is used to update the weights? Couldn't find anything specific about it anywhere.
1
vote
1answer
57 views

Difference between Non linear regression vs Polynomial regression

I have been reading a couple of articles regarding polynomial regression vs non-linear regression, but they say that both are a different concept. I mean when you say polynomial regression, it, in ...
0
votes
3answers
122 views

Gradient decent in Python

I just finished working on my first machine learning algorithm i.e Linear regression. I want to reduce the rmse by optimising the model. I found out that gradient decent does the same job. But i dont ...
1
vote
1answer
39 views

Linear regression compute theta

I'm trying to compute the theta for a regression linear exercice. ...
0
votes
2answers
20 views

Convey time lag information to a linear regression model

I am using a simple linear regression to predict the number of units an item has moved and price of the item is one of the input parameters. For a few items, the older prices are not relevant and ...
0
votes
0answers
19 views

Can linear classifiers be used at each node of a decision tree instead of the lines parallel to any one of the axes?

I am relatively new to AI/ML. I came across this question while reading some content on ML. Would be of great help if anyone can answer this

1 2 3 4 5 9