Questions tagged [linear-regression]

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

192 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7 votes
0 answers
513 views

differences between LSQR and FTRL when working with very sparse data

I have a 2M instances dataset with millions of very very sparse dummy variables created using the hashing trick = ...
ihadanny's user avatar
  • 1,357
5 votes
1 answer
710 views

Linear Regression bad results after log transformation

I have a dataset that has the following columns: The variable I'm trying to predict is "rent". My dataset looks a lot similar to what happens in this notebook. I tried to normalize the rent ...
Caldass_'s user avatar
  • 167
3 votes
0 answers
223 views

Multi-dimensional Euclidian R^2 squared - reasonable?

I have a high-dimensional space, say $\mathbb{R}^{1000}$, and I have samples $y_1, \ldots , y_n \in \mathbb{R}^{1000}$ and $\hat{y}_1, \ldots , \hat{y}_n \in \mathbb{R}^{1000}$. Would $$ R^2 = 1 - \...
AspiringToAspire's user avatar
3 votes
1 answer
50 views

How best to use the resale transaction year in predicting housing prices?

I'm looking into the classic problem of predicting apartment prices (resale market) based on the their type, size, location, etc. Pretty straightforward and Linear Regression or Regression Trees give ...
Christian's user avatar
  • 171
3 votes
0 answers
909 views

How to retrieve results summary from statsmodels GLM with regularization?

I'm trying to fit a GLM to predict continuous variables between 0 and 1 with statsmodels. Because I have more features than data, I need to regularize. ...
Rylan Schaeffer's user avatar
3 votes
1 answer
2k 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 ...
ronald reagan's user avatar
3 votes
2 answers
2k views

Partitioning data into features/labels and train/test after reading from csv file

I need to read data from a CSV file and then the first partition that data into features and labels and then into the training and testing set. However, there are several issues cropping up again and ...
ravi's user avatar
  • 141
3 votes
3 answers
2k views

Piece-wise regression by clustering

I was wondering about the possibilities of clustering numerical data (more than 3 dimensions) into different clusters and doing curve fitting on each cluster to get much higher accuracy than using a ...
cjMec's user avatar
  • 141
3 votes
0 answers
1k views

How to predict Estimated Time for Arrival given only trajectory data and time?

I have data of latitude, longitude and timestamp. I am trying to build a graph based on pincodes (in India) (equivalent to zipcode). Based on this graph and trajectory data that I have, I want to ...
user825828's user avatar
3 votes
1 answer
146 views

Is it ok to trust regression predictions when none of the coefficients are statistically significant?

Background to the problem: I am estimating individual treatment effects using double machine learning model. I do not know true treatment effects for my problem. Double ML: Given Y (outcome), T (...
Chandra's user avatar
  • 131
2 votes
1 answer
21 views

Why would the result change so much for a linear regression with or without a constant?

I was running a Linear Regression with Wooldridge dataset named GPA2, which is found on Python library named wooldridge. I tried two linear regressions. The first: ...
dsbr__0's user avatar
  • 191
2 votes
2 answers
460 views

Why do we don't write units with MAE or RSME for regression problem ? If I wish to write the units when how do I identify the units for them?

I have referred many research paper but no one is talking about the units of the metrics. Do MAE , RMSE etc have some units ?
Savita Lonare's user avatar
2 votes
1 answer
39 views

Return the gradient and y intercept (m, b) to create two lines to best fit the data

I have been working on this task for a few hours now and have been unsuccessful with getting the target result. I have tried using multiple methods of trying to split the dataset using different ...
Sultan's user avatar
  • 21
2 votes
0 answers
551 views

Linear regression with Pytorch not converging

I am trying to perform a simple linear regression using Pytorch lightning (a network with only one neuron). The network is supposed to learn a simple function: y=-4x...
erap129's user avatar
  • 121
2 votes
1 answer
630 views

Why not using linear regression for finetuning the last layer of a neural network?

In transfer learning, often only the last layer of the network is retrained using gradient descent. However, the last layer of a common neural network performs only a linear transformation, so why do ...
Funkwecker's user avatar
2 votes
0 answers
228 views

How to process categorical variable having lots of unique values in linear regression?

I have House Price dataset and I am using linear regression to predict the house price. while data preprocessing I found a variable called "Location" and it have around 342 unique value. For ...
Rahul Pawade's user avatar
2 votes
0 answers
146 views

Interpretation of the output from qqPlot (using car library)

Basically, I have created a linear model and am testing to verify the normality of my errors. As a result, I have used the qqPlot function from the car library and have gotten the graph that can be ...
Ali Shana'a's user avatar
2 votes
0 answers
138 views

Reproduce Figure 3.2 in Introduction to Statistical Learning

Has anyone reproduced Figure 3.2 in Introduction to Statistical Learning (James et al)? https://trevorhastie.github.io/ISLR/ISLR%20Seventh%20Printing.pdf They have a contour plot with circles. Here is ...
Andy Draper's user avatar
2 votes
0 answers
112 views

Deriving vectorized form of linear regression

We first have the weights of a D dimensional vector $w$ and a D dimensional predictor vector $x$, which are all indexed by $j$. There are $N$ observations, all D dimensional. $t$ is our targets, i.e, ...
user2793618's user avatar
2 votes
1 answer
123 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 for my analysis have been selected using p-values and domain knowledge. After selecting these features, the performance of $R^2$ and the $...
Shahnawaz Khan's user avatar
2 votes
1 answer
881 views

Omnibus and R square improvements for OLS model

Checking on this community if any one can help with this problem posted on Cross Validated. Detailed question is as below: ...
SKB's user avatar
  • 554
2 votes
0 answers
154 views

Why do you need to use group lasso with categorical variables?

From what I've read you should you use group lasso to either discard the dummy encoded variables (of the category) or use all of them. If you use normal lasso then some of the variables in the group ...
Ferus's user avatar
  • 121
2 votes
0 answers
55 views

Least squares with non-negative eigen values

I am trying to use least squares to solve a problem of the form $u = - K v$ where u and v are vectors of size 3, and K is a 3X3 matrix. Where I want to estimate K, given u and v. I have multiple ...
Dhruv Balwada's user avatar
2 votes
1 answer
553 views

Target Variable Encoding for Time Series Change point detection

I am working on a time series data for which I intend to impliment machine learning model for detecting change point in time series data. This data is recorded fom machinary and we have to predict ...
Bhakti's user avatar
  • 171
2 votes
0 answers
36 views

Varying strength of prior for MCMC hierarchical linear model

I am training an MCMC model in using Pymc3. My aim is to build a series of linear regression models which will predict the time to unload a truck, based on the number of crates to unload. I have ...
Tom's user avatar
  • 141
2 votes
3 answers
90 views

Dealing with diverse groups in regression

What happens if a certain dataset contains different "groups" that follow different linear models? For example, let's imagine that examining the scatterplot of a certain feature $x_i$ against $y$ we ...
Kira Bulatov's user avatar
2 votes
0 answers
176 views

How to create a global model with personalized features for multi-label classification problem

I'm trying to predict additional recipients of a message given the content of the message (like subject and body) and the current recipients of the message. for ex: I have 4 users in the system U1, ...
user330612's user avatar
2 votes
0 answers
64 views

local regression with streaming data

From a data stream i'm receiving a pair of measurements consisting of a current consumption and a current percentage every second. By accumulating the consumption over time it will represent ...
R. Doe's user avatar
  • 251
2 votes
1 answer
108 views

Can we predict correlation between independent variables based on dependent variables

I have a correlation matrix for dependent var Vs independent variable as below: Year 1 Sales Sales -0.5453 1.0000 PriceIndex -0.6089 Income -0.5033 Interest -0.3842 As we ...
Shivi's user avatar
  • 31
2 votes
1 answer
105 views

Model performance impact on social discrimination?

I am currently working on a project where the data concerns people and the dataset contain personal data with sensitive attributes. (typically: age, sex, handicap, race). Now it seems there are mainly ...
Lucas Morin's user avatar
  • 2,093
1 vote
0 answers
30 views

With infinite observations, would the weights resulting from ridge regression be the same as simple linear regression?

As the number of observations approaches infinity, do the weights of a linear regression approach the weights of a linear regression with L2 penalty?
BigMistake's user avatar
1 vote
1 answer
257 views

How to curve fit, Z variable dependent on X and Y?

I'm trying to find the function for this visualization: I would like to get feedback if I'm taking the right approach. My approach: These data points are created by a person. They are two ...
Stanko's user avatar
  • 111
1 vote
0 answers
89 views

Linear Regression on Time Series

I have a csv file containing values of X and Y variables. i have been asked to use this to build a linear regression model that can predict the current value of the variable 𝑋 based on its previous ...
Mohammad Khan's user avatar
1 vote
0 answers
48 views

How to guide exploration in reinforcement leanring/model predictive control/dual control problem

Consider the following optimization/control problem: We aim to maximize the cumulative reward R during the horizon H by every day allocating a portion of total budget B to our two different investment ...
stewardbranson's user avatar
1 vote
0 answers
89 views

Why is a neural network not doing better than multivariate linear regressions?

I am making neural networks of multiple targets, all using same training data. For some of these targets, multivariate linear regressions do a very good job, i.e. a strong linear relation exists ...
Socorro's user avatar
  • 101
1 vote
0 answers
175 views

Why would a Linear SVR model greatly outperform a Linear Regression model on model stacking

I have built nine meta models based on the model stacking principle, which I compare to a reference model for a number of time series. See the results below. The 22 base models that are trained on 70% ...
Tim Stack's user avatar
  • 121
1 vote
0 answers
230 views

Multi Linear Regression on String Values

I'm using datasets which involves mostly of string values. The main outcome of the project is that it should predict success. Now I can use OneHotEncoding to convert string values in numerical format ...
Abdul Munim's user avatar
1 vote
0 answers
41 views

Need help to understand the formula of gradient descent with multiple features

I am trying to implement gradient descent with multiple features after listening to Andrew Ng's Coursera lecture. gradient descent for multiple features So for example when calculating for theta 1, ...
ml_noob's user avatar
  • 11
1 vote
0 answers
13 views

Linear regresion for multiple time series

I have some data with this shape: ...
Alexandre Dumont's user avatar
1 vote
1 answer
16 views

How to perform linear regression on a parameter that represents state/configuration of a machinery in a production process?

I am trying to perform linear regression on a manufacturing process in order to determine the influencing parameters on a particular product. The thing is there are several production parameters, and ...
Manas Pandey's user avatar
1 vote
0 answers
46 views

Extracting Linear Trend from Time Series Data

I'd want to show that the behavior of our customers with the most customer support follows a different trend than our overall customers (with less support). As you can imagine, a linear fit to Time ...
Romero Azzalini's user avatar
1 vote
1 answer
61 views

How to fill missing values in a discrete column in sales predictions for a drug supply chain company

I have been working on a dataset that has data from a famous drug supply chain company. The first few records of the dataset look like the following; Another data accompanies this (primary) dataset. ...
Ritik P. Nayak's user avatar
1 vote
1 answer
53 views

Can anyone help me about cost function in linear regression. As from the below plot we have input values and predicted value there is no Y value, help

Can anyone help out please? I don't understand this
khushbul alam's user avatar
1 vote
0 answers
66 views

statistical tests for null hypothesis - what if model is non linear?

I am reading the "An Introduction to Statistical Learning" (Gareth James & alii, Springer) as a primer to machine learning. I am reading the part in linear regressors, and learnt there ...
user305883's user avatar
1 vote
0 answers
52 views

Why the line of Linear Regression is same as deming regression?

This is not a coding question. My doubt is purely mathematical. Say I take three points (1,2) (2,1) and (4,3) A. I calculate the least fit line for linear regression. Simple linear regression(which ...
Ashish Gour's user avatar
1 vote
1 answer
46 views

Why are we not checking the significance of the coefficients in Lasso and elastic net models

As far as I know, we don't check the coefficient significance in Lasso and elasticnet models. Is it because insignificant feature coefficients will be driven to zero in these models?. Does that mean ...
NAS_2339's user avatar
  • 233
1 vote
0 answers
28 views

Why there is a marked difference in metric scores using linear regression or MLP as readout for echo state network?

I am using a reservoir computing architecture comprising of an echo state network as per the paper Reservoir Computing Approaches for Representation and Classification of Multivariate Time Series ...
Jag's user avatar
  • 111
1 vote
0 answers
42 views

Does the appliance of R-squared to non-linear models depends on how we calculate it?

Does the appliance of R-squared to non-linear models depends on how we calculate it? $R^2 = \frac{SS_{exp}}{SS_{tot}}$ is going to be an inadequate measure for non-linear models since an increase of $...
mathgeek's user avatar
  • 121
1 vote
0 answers
118 views

Implementation of a perceptron

I want to implement a single perceptron for linear regression using the following formulas: the input data for the first case is one column (x(392, 1); y(392, 1)) and for the second case is (x(392, 7)...
Rim Sleimi's user avatar
1 vote
0 answers
57 views

Group points to reduce data set such that the linear regression stays the same

I have a very long dataset and I'm trying to reduce it by grouping the data in periods of 24 hours. In this way, there will be a single data point that represents that day, but they must yield the ...
Schroeder's user avatar