Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [linear-regression]

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

1
vote
1answer
11 views

Elements of Statistical Learning - question on p. 12

I am starting to work through Elements of Statistical Learning, and right off the bat I am coming across things that I don't understand. I would be grateful for any help from this community. Please ...
0
votes
1answer
14 views

Reducing MAE or RMSE of linear regression

I'm trying to guess a home price, at final I intend to figure out a formula by using linear regression. As you can see over the url, I have 1480 data with 45 features in which ...
1
vote
2answers
12 views
1
vote
1answer
25 views

After plotting my predicted values against the true label values, I didnt quite get the answer I was looking for

I downloaded data on wine quality and tried to run a regression model to predict the quality, However I did not receive the plot I was expecting. The mean absolute error for the wine quality was ...
0
votes
1answer
22 views

When I try to predict with my model I get an Attribute error

After I've created my model using keras sequential, I tried to start predicting on a small sample to see if it would work however I get this error and I have no idea why. error : AttributeError ...
1
vote
1answer
18 views

Why does my linear regression model converge to a non-zero gradient value?

I have a basic 2D Linear Regression model coded out (using gradient descent), yet it doesn't seem to work as well as it should. What I expect is that m and ...
0
votes
0answers
11 views

How can Clustering (Unsupervised Learning) be used to improve the accuracy of Linear Regression model (Supervised Learning)

I came through this questions and I failed to find the right answer for it. How can Clustering (Unsupervised Learning) be used to improve the accuracy of Linear Regression model (Supervised Learning)?...
0
votes
1answer
34 views

Football match prediction using regression

I am trying to predict goal difference of football matches in keras using a single layer Neural Network. I used mse as metrics and its a low value aroung 0.05 but some predictions has huge difference. ...
0
votes
1answer
23 views

R - newdata has X rows but variables have X rows

I have a dataset dimensions 1142obs in 454 variables. I've used 'caret' to separate into training and testing datasets. training =858 obs of 99 var testing =284obs of 99 var I make a linear ...
1
vote
1answer
45 views

Predicting house price using linear regression

I'm trying to predict a house price using linear regression method. I gather the real data from a real estate website. I have some features and two numerical value in which the price is the target ...
0
votes
1answer
14 views

Neural net without hidden layers should be a simple linear model: why do I get so different results?

I’m reading „Elements of Statistical Learning“ where Hastie et al. describe in Section 11.3 on neural nets (p. 394), that (in short) if there are no hidden layers in a neural net (so without non-...
0
votes
3answers
31 views

How to approach this data set for linear regression?

I am new to data science and am currently working on a data science project and have to answer a few questions about the following data set with 18k data points: https://www.kaggle.com/karangadiya/...
0
votes
0answers
13 views

if a time series is not stationary at a weekly level, is it also not stationary at quarterly level?

I have time series of sales of many products on weekly level for 2 years. I am interested in forecasting the sales on quarterly (4-months) level for every product. I also have some exogenous ...
3
votes
1answer
38 views

statsmodels ols does not include all categorical values

I am doing an ordinary least squares regression (in python with statsmodels) using a categorical variable as a predictor. There are 5 values that the categorical variable can have. However, after ...
1
vote
0answers
14 views

Orange 3 - How can a String feature behave as a coefficient?

I'm studying machine learning with data. I have a table including features and a target variable which is the price as in the following. When I want to figure out the coefficients to obtain linear ...
1
vote
1answer
18 views

How is the linear regression cost function evolved?

A couple of weeks ago I joined the Standford University machine learning course on Coursera. In that course, they directly gave the cost function formula without telling how this formula was evolved. ...
1
vote
1answer
20 views

Is linear regression suitable for these data?

I have a data set predicting a continuous variable, $Y$. I have $15$ to $20$ potential feature variables most of which are categorical, some of which are ordinal or categorical. These have been ...
1
vote
1answer
47 views

Simple linear regression in PyTorch

I am performing simple linear regression using PyTorch but my model is not able to properly fit over the training data. please look at the code to find the mistake. Dataset is here ...
0
votes
1answer
29 views

finding optimal solution $w$ and classification accuracy

Suppose you are given $6$ one-dimensional points: $3$ with negative labels $x_1 = −1$, $x_2 = 0$, $x_3 = 1$ and $3$ with positive labels $x_4 = −3$, $x_5 = −2$, $x_6 = 3$. In this question, we first ...
0
votes
2answers
41 views

Sum of Least Squares vs Variance

When trying to fit a line to data, using linear regression, we would like it to have the lowest sum of squared differences (least squares method). I am wondering why we use this technique instead of ...
2
votes
1answer
44 views

Training a model where each response in the observation data has a different known varience

I have a dataset where each response variable is the number of successes of N Bernoulli trials with N and p (the probability of success) being different for each observation. The goal is to train a ...
0
votes
0answers
40 views

Price Prediction via Neural Network (Keras)

I am trying to do call price prediction my data set looks something like this ...
1
vote
1answer
17 views

Modelling regressor of historic data on basic features test set

I am using a historical dataset of sales of items in shops and I need to predict the sales of the next month of the period. I performed feature engineering, and now I have 10 feature in the train ...
0
votes
1answer
32 views

Quasi-linearity in deep learning regression problems (sports betting)

I’m attempting to build a sports betting model that aims to predict final scores for games. I’ve had some promising early results for US college football just by using linear regression to form team ...
1
vote
2answers
47 views

Predicting yearly income with linear regression using Python

How to predict the per capita income of Pakistan in 2020 by using linear regression model in Python. The training data is: ...
0
votes
1answer
22 views

What does coefficient mean for a binary independent variable in multiple linear regression?

Let's say I have a multiple linear regression model where my dependent variable, Y, is an integer. And, one of my independent variables --x1-- is binary --let's say either 0 or 1. We know that sign ...
0
votes
1answer
30 views

Adding a custom constraint to weighted least squares regression model

I am trying to run a weighted least squares model that looks something like this (but could be different): $y = \beta_0 + \beta_1 x + \beta_2 log(x) + \epsilon$ with weights $w_1, w_2, ..$ However,...
0
votes
2answers
28 views

Linear regression incorrect prediction using Matlab

In the plot below the red crossed line is the actual curve and the crossed blue line is the predicted curve. I am using least squares for linear prediction. I have used 1:79 examples in training and ...
2
votes
1answer
58 views

Time Series - Models seem to not learn

I am doing my undergrad Dissertation on time series prediction, and use various models (linear /ridge regression, AR(2), Random Forest, SVR, and 4 variations of Neural Networks) to try and 'predict' (...
1
vote
1answer
40 views

How Dummy Variables Should Be Modeled In A Linear Regression Model?

I've a cross sectional model where I want predict number of users that take specific service, to make it I've many variables but have specifically two nominal: isWorkday(0 or 1) and weeday(1,2,3,...,7)...
0
votes
1answer
27 views

Distribution of error values in linear regression vs logistic regression

Why do error values in linear regression have to be normally distributed and why not in logistic regression?
1
vote
1answer
23 views

Interpreting coefficients after transforming Y (dependent) variable

I have been working on linear regression for forecasting purposes. I have a model where I have used a BoxCox transformation on the $Y$ variable (Sales) with $\lambda = 0.3$. The model is as follows: ...
0
votes
0answers
22 views

How does on test regression for a subspace or matrix factorization?

I've recently been reading a lot of papers and watching a lot of videos on both subspace learning, and matrix factorization. One thing is particularly eluding me though - how does any of this get ...
0
votes
2answers
65 views

Why split data into train and test in linear regression?

I am wondering how train and test set works in linear regression. If I train the data it will give me a line of best fit, say I for my train data I am using first 70% of dataset => first 70% of the ...
2
votes
1answer
118 views

multi-output regression problem with tensorflow

number of features: 12 , -15 < each feature < 15 number of targets: 6 , 0 < each target < 360 number of examples: 262144 my normalization: I normalized the features so that they are ...
5
votes
2answers
63 views

How do I fit a curve into non linear data?

I did an experiment in my Uni and I collected data $(ω,υ(ω))$ modeled by the equation: $$ v(ω)=\frac{C}{\sqrt{(ω^2-ω_0^2 )^2 +γ^2 ω^2}} $$ where $ω_0$ is known. Do you know how can I fit a curve to ...
0
votes
1answer
26 views

Multiple regression (using machine learning - how plot data)

I wonder how I can use machine learning to plot multiple linear regression in a figure. I have one independent variable (prices of apartments) and five independent (floor, builtyear, roomnumber, ...
1
vote
1answer
51 views

Optimizing vector values for maximum correlation

I'm new to ML, linear algebra, statistics, etc. so bear with me on the terminology... I’m looking to find a vector that produces the maximum correlation for the relationship between 1) all ...
0
votes
1answer
60 views

Can a Neural Network Measure the Random Error in a Linear Series?

I have been trying to develop a neural network to measure the error in a linear series. What I would like the model to do is infer a linear regression line and then measure the mean absolute error ...
1
vote
1answer
45 views

neural network to find a very simple linear model (scikit-learn)

I'm trying to test different machine learning algorithm to try to find correlation between various data on MRI scans. Since I'm dealing with medical data, I don't have access to many events, but still ...
1
vote
0answers
34 views

Linear regression load model doesn't predict as expected

I have trained a linear regression model, with sklearn, for a 5 star rating and it's good enough. I have used Doc2vec to create my vectors, and saved that model. Then I save the linear regression ...
2
votes
1answer
55 views

Understanding minimizing cost correctly

I cannot wrap my head around this simple concept. Suppose we have a linear regression, and there is a single parameter theta to be optimized (for simplicity purposes): $h(x) = \theta \cdot x$ The ...
2
votes
1answer
89 views

Normalizing the data set

I have two questions : Why doesn't normalization have any effect on linear regressor performance (mathematical approach is appreciated ) ? When we normalize the training set we ought to normalize ...
2
votes
1answer
31 views

Can I use Linear Regression to model a nonlinear function?

I have recently started studying the basics about regression, and as a beginner I started by Linear Regression. I read this article that says that for this particular type of regression the ...
0
votes
2answers
27 views

How do I correctly build model on given data to predict target parameter?

I have some dataset which contains different paramteres and data.head() looks like this Applied some preprocessing and performed Feature ranking - ...
1
vote
1answer
57 views

Partial least squares (PLS)

I am relatively new to Orange, trying to utilise it for linear regression, in particular partial least squares (PLS). My statistics knowledge is in the moment not good enough to know whether I could ...
4
votes
2answers
62 views

Difference between output of probabilistic and ordinary least squares regressions

If I execute the commands my_reg = LinearRegression() lin.reg.fit(X,Y) I train my model. To my understanding training a model is calculating coefficient ...
2
votes
1answer
42 views

How to do vocabulary estimation based on observed writings?

Below is a scatter plot of the data set I am dealing with. The X axis is the total number of words per essay for a particular individual, and they Y axis is the number of unique words. In principle, ...
0
votes
2answers
40 views

How to handle continuous values and a binary target?

This is going to be a very beginner's question. I have a datset of continues features like LoanAmount, LoanDuration(multiclass?), ... ClientIncome, ClientFreeSources, etc. and a binary target whether ...
0
votes
2answers
22 views

What is purpose of partial derivatives in loss calculation (linear regression)?

I am studying ML and data science stuff from scratch. As a part of the course, I am studying how the models are derived. And for most of them, starting with the simplest - linear regression, we take ...